		TITLE	LNKDAT - Copyright (c) SLR Systems 1994

		INCLUDE MACROS
		INCLUDE	IO_STRUC
		INCLUDE	SEGMENTS
		INCLUDE	MODULES
		INCLUDE	FIXTEMPS
		INCLUDE	EXES
		INCLUDE	RELEASE
if	fgh_win32dll
		INCLUDE	SYMCMACS
endif
if	fg_td
		INCLUDE	TDBG
endif
if	fg_segm OR fg_pe
		INCLUDE	SEGMSYMS
endif
if	fg_pe
		INCLUDE	PE_STRUC
endif
		INCLUDE	WIN32DEF
if	fg_slrpack
		INCLUDE	SLR32
endif

		PUBLIC	FILNAM,MYI_STUFF,SRCNAM,MODULE_NAME,CRLF,CURN_INPTR,CURN_COUNT,FILESTUFF_PTR,OBJ_DEVICE,SYMBOL_HASH,CNS_OFFSET
		PUBLIC	ASCIZ,OUTBUF,THEADR_TEMP,DICT_BLOCKS,CURN_LIB_BLOCK,OUTFILE_NUMBER,FIRST_OUTFILE_GINDEX,FSYMBEG,FSYMEND
		PUBLIC	TEMP_RECORD,SYMBOL_LENGTH,INBUF,LAST_OUTFILE_GINDEX,SYM_HASH,SYM_HASH_LOG,SYM_HASH_MOD,INPTR1,ERR_NUMBER
		PUBLIC	SYMBOL_TEXT,MULTI_HASH_LOG,SEG_COMBINE,SEG_ALIGN,SEG_FRAME,SEGMENT_HASH_TABLE_PTR,COMM_SIZE_A,__stack
		PUBLIC	MYO_STUFF,DTA,EOUTBUF,XOUTBUF,SEG_LEN,SEG_NAME_LINDEX,CLASS_NAME_LINDEX,CLASS_TYPE,MODULE_HASH_TABLE_PTR
		PUBLIC	EXETABLE,PRE_THREADS,CLASS_DEBTYP_GINDEX,CURNMOD_GINDEX,END_OF_RECORD,LDATA_TYPE,FIRST_ALIASED_GINDEX,DEFAULT_SIZE
		PUBLIC	TEMP_DATA_RECORD,RECORD_TYPE,RECORD_LENGTH,FIRST_GROUP_GINDEX,RELOC_GARRAY,SRC_GARRAY,MOD_FIRST_SRC_GINDEX
		PUBLIC	NEW_FIXUPP,FINAL_TABLE,HIGH_PC,LISTTYPE,OBJ_LIST,GROUP_NAME_LINDEX,SRC_COUNT,LAST_EXTDEF_GINDEX,LOD_LIST
		PUBLIC	FILENAME_HASH,FILENAME_HASH_TABLE_PTR,FILE_HASH_MOD,OBJPATH_LIST,LIBPATH_LIST,LIN_GROUP_GINDEX,LIN_SEGMOD_GINDEX
		PUBLIC	TEMP_FIXUPP_RECORD,LIBASE_TEMP_RECORD,FINAL_RANGES,RELOC_COUNT,RELOC_BITS,LIDATA_RELOCS_NEXT,RELOC_STUFF
		PUBLIC	FORREF_TEMP_RECORD,RELOC_HIGH_WATER,OPTI_RELOC_CLEAR,LIDATA_RELOCS_START,FIRST_STACK_GINDEX,LDATA_SEGMOD_GINDEX,_OUTFILE_GINDEX
		PUBLIC	LAST_DATA_PTR,PREV_DATA_PTR,LDATA_LENGTH,LDATA_LOC,FIRST_SEGMENT_GINDEX,LAST_SEGMENT_GINDEX,FIRST_CLASS_GINDEX
		PUBLIC	MAPFILE_GINDEX,FIRST_LIB_GINDEX,LAST_LIB_GINDEX,FIRST_REQUEST_LIB_GINDEX,LS_BLOCK,OPTI_MOVE,LIB_TEMP_WORD
		PUBLIC	LAST_REQUEST_LIB_GINDEX,FIRST_WEAK_GINDEX,LAST_WEAK_GINDEX,FIRST_EXTERNAL_GINDEX,LAST_EXTERNAL_GINDEX,LIB_MODULES,MAX_PAGEDWORD,LIB_LIST
		PUBLIC	CURN_LIB_BLOCK_PTR,LS_MODULE_PTR,NUMBLKS,LNKDIR_FLAGS,CLASS_HASH,P1ONLY_STUFF,TILLMIDDLE_STUFF,XREF_STUFF
		PUBLIC	FCA_STUFF,LDA_STUFF,DBG_SYM_STUFF,COD_STUFF,SEGMENT_STUFF,FIRST_MDB_GINDEX,PUB_CV,ZERO_BYTES
		PUBLIC	ENVIRONMENT_BLOCK,ASCIZ_LEN,FIRST_FINAL_SEGMENT_GINDEX,CURN_OUTFILE_BASE_ADDRESS,PLINK_LEVEL,LNKDIR_PCODE_CV,FLAGS,CSEG_GARRAY
		PUBLIC	DONT_PACK,R_DONT_PACK,FIRST_FARCALL,LAST_FARCALL,MODULE_HASH,SYMBOL_TABLE_USE,ENTRYPOINT_GINDEX,ENTRYPOINT_TXT
		PUBLIC	PAGEWIDTH,PAGELENGTH,CV_INFO_TYPE,CASE_TYPE,TOTAL_RELOCS,LOCKED_STUFF,N_MDB_STRUCTS,MOD_CSEG_COUNT,MDB_GARRAY
		PUBLIC	PACKCODE,PACKDATA,HIGH_WATER,LAST_SEGMOD_GINDEX,EXEHDR_ADDR,LNAME_STUFF,SEGMENT_HASH,SYMBOL_TPTR,SYM_HASH_BLK
		PUBLIC	EXESTR_STRUCTURE,MAX_FINAL_RANGES,MAX_FINAL_TABLE,FINAL_HIGH_WATER,NEW_REPT_ADDR,REAL_RELOC_STRUCT,EXP_BUFFER
		PUBLIC	MAP_DEVICE,_EXE_DEVICE,IND_DEVICE,EXE_OUT_POSITION,FIXUPP_COUNT,SP_SAVE,SEG_PAGE_SHIFT,LINSYM_FLAGS
		PUBLIC	SEG_PAGE_SIZE_M1,NOT_SEG_PAGE_SIZE_M1,OLD_HIGH_WATER,OPTI_STOSD_SIZE,OUT_INIT,OUT_NEW_SEGMENT,OUT_NEW_SEGMOD
		PUBLIC	OUT_SEGMOD_FINISH,OUT_SEGMENT_FINISH,OUT_END_OF_SEGMENTS,OUT_FLUSH_SEGMOD,OUT_FLUSH_SEGMENT,OUT_FLUSH_EXE
		PUBLIC	OUT_NEW_SECTION,OUT_END_OF_SECTION,OUT_TYPES,SYS_BASE,ALIGNMENT,TD_INFO_TYPE,MOD_FIRST_CSEGMOD_GINDEX
		PUBLIC	SEG_TYPE_MASK_DEFAULT,CURN_FILE_LIST_GINDEX,FIRST_COMMUNAL_GINDEX,LAST_COMMUNAL_GINDEX,COMMENT_CHAR,TOKSTR
		PUBLIC	LIN_SRC_GINDEX,COMM_SIZE_B,AREA_GARRAY,DGROUP_GINDEX,_TEXT_SEGMENT_GINDEX,BEGDATA_CLASS_GINDEX,BSS_CLASS_GINDEX
		PUBLIC	CURN_SECTION_FILE_ADDRESS,RELOC_CHUNK_COUNT,FIRST_CODE_GROUP_GINDEX,LAST_CODE_GROUP_GINDEX,REFERENCE_FLAGS
		PUBLIC	FIRST_DATA_GROUP_GINDEX,LAST_DATA_GROUP_GINDEX,FIRST_CODE_SEGMENT_GINDEX,LAST_CODE_SEGMENT_GINDEX,FIRST_DATA_SEGMENT_GINDEX,LAST_DATA_SEGMENT_GINDEX
		PUBLIC	SEGMENT_TABLE_PTR,INDIRECT_LEVEL,CURN_AREA_GINDEX,AREA_COUNT,INDIR_TABLE,FIRST_SECTION_GINDEX,WM_START_ADDR
		PUBLIC	CURN_SECTION_GINDEX,CURN_PLTYPE,CODEVIEW_SECTION_GINDEX,CODEVIEW_PLTYPE,CURN_OUTFILE_GINDEX,SECTION_NUMBER
		PUBLIC	FIRST_SECTION_PLTYPE,PUB_FRAME,PUB_OFFSET,PUB_TYPE,PUB_SIZE,PUB_GROUP_GINDEX,PUB_SEGMOD_GINDEX,LIN_LAST_LINNUM
		PUBLIC	LIN_SIZE,LAST_FILENAME_GINDEX,LIB_PAGE_SIZE,DICT_OFFSET,SELECTED_LIB_COUNT,LINNUM_ADDER,QN_PTR,MULTI_HASH_BLK
		PUBLIC	DOSSEG_STRUC,LIB_UNUSED_SYMBOLS_GINDEX,TYPDEF_ANDER,CURN_LIB_MODULE,C_COMMON_SEGMOD_GINDEX,RAINBOW_HASH_MOD,SOFT_SEGM
		PUBLIC	FAR_BSS_SEGMOD_GINDEX,MAJOR_MOVE_ROUTINE,FORREF_ROUTINE,FORREF_SIZE,STACK_SIZE,MODEND_OWNER_GINDEX,MODEND_ADDRESS
		PUBLIC	MOD_FIRST_PUBLIC_GINDEX,BUFFER_OFFSET,LOC_10,LOC_CALLTBL_PTR,SRCADR,CURN_SEGMOD_GINDEX,CURNMOD_NUMBER
		PUBLIC	LOUTALL,BOUTALL,_ERR_COUNT,WARN_COUNT,LAST_PUBDEF_GINDEX,VIRDEF_MCD_HASH_TABLE_PTR,GROUP_PTRS,GROUP_PTRS_PTR
		PUBLIC	EDI_SAVE,OTHERS_SAVE,LNAME_LARRAY,SEGMOD_LARRAY,CLASS_HASH_TABLE_PTR,GROUP_HASH,N_SYMBOLS,SEG32_FLAGS
		PUBLIC	GROUP_LARRAY,SYMBOL_LARRAY,CTRL_C_FLAG,LAST_CHAR,FIRST_VIRDEF_GINDEX,LAST_VIRDEF_GINDEX,SEG_SECTION_GINDEX,GROUP_HASH_TABLE_PTR
		PUBLIC	SEG_PLTYPE,LAST_DELIM,LAST_ALIASED_GINDEX,EXTDEF_DELTA,LINNUM_DELTA,NULL_TEXT_SEGMOD_GINDEX,FLOAT_FLAG
		PUBLIC	CASE_STRING_COMPARE,CURN_TIME_DWD,CURN_DATE_DWD,CURN_YEAR,CURN_MONTH,CURN_DAY,CURN_HOUR,CURN_MINUTE,FLOAT_TYPE
		PUBLIC	CURN_SECOND,CURN_HUNDREDTH,THEADR_HASH,THEADR_HASH_TABLE_PTR,MCD_FLAGS,SSYM_STUFF,CURN_DICT_LOG,IMP_DEVICE
		PUBLIC	COMDAT_VARS,COMDAT_FLAGS,COMDAT_ATTRIB,COMDAT_ALIGN,COMDAT_OFFSET,COMDAT_CV,SYM_HASH_PHYS,__psp,OPTI_HASH
		PUBLIC	COMDAT_DATA_PTR,COMDAT_TYPE,FIRST_COMDAT_GINDEX,LAST_COMDAT_GINDEX,COMDAT_GINDEX,COMM_TYPE,COMM_NUMBER
		PUBLIC	FIRST_COMDAT_SUGGESTED,LAST_COMDAT_SUGGESTED,LOCAL_HASH,LOCAL_HASH_TABLE_PTR,LAST_MYCOMDAT_LINDEX,IMP_OUTALL
		PUBLIC	LIBRARY_GARRAY,STD_ALLOC_LOG,STD_ALLOC_OFF,FIRST_WEAK_DEFINED_GINDEX,LAST_WEAK_DEFINED_GINDEX,FIRST_LAZY_GINDEX
		PUBLIC	LAST_LAZY_GINDEX,FIRST_LAZY_DEFINED_GINDEX,LAST_LAZY_DEFINED_GINDEX,FIRST_ALIAS_DEFINED_GINDEX,LAST_ALIAS_DEFINED_GINDEX,CURN_TYPE,FORREF_TYPE
		PUBLIC	FIRST_COMDAT_ORDERED_GINDEX,LAST_COMDAT_ORDERED_GINDEX,NEXT_COMDAT_SEGNUM,COMDAT_CODE_16_SEGMENT_GINDEX,COMDAT_DATA_16_SEGMENT_GINDEX
		PUBLIC	CIRCULAR_COUNT,LAST_CLASS_GINDEX,SEG_CLASS_GINDEX,OVERLAY_NUMBER,CLASS_DEBSYM_GINDEX,CLASS_GARRAY,_FILE_LIST_GARRAY
		PUBLIC	LAST_GROUP_GINDEX,SYMBOL_GARRAY,SEGMENT_GARRAY,SEGMOD_GARRAY,GROUP_GARRAY,MODULE_GARRAY,OUTFILE_GARRAY,SECTION_GARRAY
		PUBLIC	STACK_CLASS_GINDEX,DEBTYP_CLASS_GINDEX,LAST_MODULE_GINDEX,COMDAT_REF_FLAGS,COMDAT_SEGMOD_GINDEX,MYCOMDAT_LINDEX
		PUBLIC	COMDAT_GROUP_LINDEX,COMDAT_SEGMOD_LINDEX,CODE_16_SEG_LEN,DATA_16_SEG_LEN,SYMBOL_LARRAY_TBL,LNAME_LARRAY_TBL
		PUBLIC	SEGMOD_LARRAY_TBL,GROUP_LARRAY_TBL,DEBSYM_CLASS_GINDEX,CODE_CLASS_GINDEX,ME_PTR,EMS_MAX_1K_BLOCKS
		PUBLIC	LIB_MODULE_PTR_LAST_OFFSET,LIB_MODULE_PTR_BLOCKS,COMDAT_PARENT_SEGMOD_GINDEX,PACK_DEFAULT_SIZE,FLAT_GINDEX
		PUBLIC	XMS_MAX_1K_BLOCKS,DEBUG_TYPES_SELECTED,HOST_BASE,UNDECO_HASH,UNDECO_HASH_PHYS,UNMANGLE_STUFF,ME_PATH_LEN
		PUBLIC	MDB_TABLE_USE,DEBNAM_CLASS_GINDEX,CLASS_DEBNAM_GINDEX,COMDAT_CODE_32_SEGMENT_GINDEX,STARTING_ESP,INDNAM
		PUBLIC	COMDAT_DATA_32_SEGMENT_GINDEX,CODE_32_SEG_LEN,DATA_32_SEG_LEN,CURN_C_TIME,MEMORY_MODEL,DOSX_HDR_SIZE
		PUBLIC	LOC_11_FIX,VIRDEF_MCD_HASH,LOCAL_HASH_TABLE_PTR_OLD,CURNLIB_GINDEX,CURN_LS_BLOCK_TABLE_PTR,LAST_MDB_GINDEX
		PUBLIC	CURN_LIB_BLOCK_PTR_LIMIT,MOD_LAST_SRC_GINDEX,FIRST_AREA_GINDEX,LAST_SECTION_GINDEX,FIRST_MODULE_GINDEX
		PUBLIC	MDB_STRUCT_SIZE,SECTION_COUNT,FIRST_RELOC_GINDEX,LAST_RELOC_GINDEX,GROUP_COUNT,CURNLIB_NUMBER,MODULE_COUNT
                PUBLIC	GINPUT_LINE_NUMBER

if fg_rom
		PUBLIC	HEX_OUTBUF
endif


		.CODE	ROOT_TEXT

		EXTERNDEF	CLASS_POOL_GET:PROC,TEXT_POOL_GET:PROC,SSYM_POOL_GET:PROC,SEGMENT_POOL_GET:PROC
		EXTERNDEF	SEGMOD_POOL_GET:PROC,GROUP_POOL_GET:PROC,ROOT_RET:PROC,MODULE_POOL_GET:PROC,TILLP2_POOL_GET:PROC
		EXTERNDEF	SECTION_POOL_GET:PROC,RELOC_POOL_GET:PROC,TD_GLOCAL_POOL_GET:PROC,IMPNAME_POOL_GET:PROC
		EXTERNDEF	ENTRYNAME_POOL_GET:PROC,PENT_POOL_GET:PROC,ENTRY_POOL_GET:PROC,TD_GTYPE_POOL_GET:PROC
		EXTERNDEF	ALLOC_LOCAL:PROC,TD_GCLASS_POOL_GET:PROC,PAGE_RELOC_POOL_GET:PROC,IMPMOD_POOL_GET:PROC
		EXTERNDEF	RESNAME_POOL_GET:PROC,RESTYPE_POOL_GET:PROC,RES_TYPENAME_POOL_GET:PROC,RTNL_POOL_GET:PROC
		EXTERNDEF	CV_GSYM_POOL_GET:PROC,CV_LTYPE_POOL_GET:PROC,CV_GTYPE_POOL_GET:PROC,CV_SSYM_POOL_GET:PROC
		EXTERNDEF	CV_HASHES_POOL_GET:PROC

		EXTERNDEF	LIBRARY_EQU:ABS,SEGCLASS_EQU:ABS,FILES_EQU:ABS,PUBSYMS_EQU:ABS,SEGMENTS_EQU:ABS,SEGMODS_EQU:ABS
		EXTERNDEF	GROUPS_EQU:ABS,MODULES_EQU:ABS,OUTFILES_EQU:ABS,AREAS_EQU:ABS,SECTIONS_EQU:ABS,CSEGS_EQU:ABS
		EXTERNDEF	RELOCS_EQU:ABS,SRCS_EQU:ABS,TDLOCALS_EQU:ABS,TDCLASSES_EQU:ABS,TDLTYPES_EQU:ABS,TDLCLASSES_EQU:ABS
		EXTERNDEF	TDLMEMBERS_EQU:ABS,IMPNAMES_EQU:ABS,ENTNAMES_EQU:ABS,PENTS_EQU:ABS,ENTRIES_EQU:ABS,IMPMODS_EQU:ABS
		EXTERNDEF	PAGE_RELOCS_EQU:ABS,RESNAMES_EQU:ABS,RESTYPES_EQU:ABS,RES_TYPENAMES_EQU:ABS,RTNLS_EQU:ABS
		EXTERNDEF	CVLTYPES_EQU:ABS,CVGSYMS_EQU:ABS,CVGTYPES_EQU:ABS,CVSSYMS_EQU:ABS,MDBS_EQU:ABS,CVHASHES_EQU:ABS


		.DATA

__stack			DD	64K
__psp			DD	?
__envptr		DD	?

if	fgh_dosx OR fgh_win32

		.DATA?

		PUBLIC	__envptr,PHYS_TABLE,PHYS_TABLE_ENTRIES

PHYS_TABLE_ENTRIES	DD	?

PHYS_TABLE		DD	PAGE_SIZE/4 DUP(?)

endif
		.DATA


if	fgh_win32dll
		PUBLIC	CMDLINE_BLOCK,MY_ARGC,MY_ARGV,TOOL_CALLBACKS,TOOL_MESSAGE,TOOL_DATA,HINSTANCE
		PUBLIC	YIELD_COUNT,GLOBAL_BLOCKS,HOST_ESP,ERROR_ASCIZ

		ALIGN	4

CMDLINE_BLOCK	DD	0
MY_ARGC		DD	0
MY_ARGV		DD	0
TOOL_CALLBACKS	TOOL_CALLBACKS_STRUCT	<VERSION_TOOLCALLBACKS>
TOOL_MESSAGE	TOOL_MESSAGE_STRUCT	<TOOLMSG_VERSION>
TOOL_DATA	TOOL_DATA_STRUCT	<TOOL_ACTIVITY,TOOL_TITLE,TOOL_COPYRIGHT,RELEASE_NUM>

HINSTANCE	DD	0
YIELD_COUNT	DD	0
HOST_ESP	DD	0

TOOL_ACTIVITY	DB	'LINKING',0
TOOL_TITLE	DB	'Digital Mars OPTLINK',174,' Version 7.00a1',0
TOOL_COPYRIGHT	DB	'Copyright ',169,' 1993-2004 Digital Mars',0

		.DATA?

GLOBAL_BLOCKS	DB	64K/8 DUP(?)

		.DATA

endif


if	fgh_inthreads

		PUBLIC	NEXT_READ_THREAD,NEXT_READLIB_THREAD

NEXT_READ_THREAD	DD	-1
NEXT_READLIB_THREAD	DD	-1

endif


if	fgh_outhreads
		PUBLIC	MRR_OTHREAD

MRR_OTHREAD	LABEL	BYTE
XXX		=	0
		REPT	N_W_THREADS
		DD	OFFSET MYO_STUFF + XXX
XXX = XXX+SIZE MYO_STRUCT
		ENDM

endif

;		DB	'** CHRIST is the Answer **'

if fg_virt

		PUBLIC	VMFILE_TEXT

VMFILE_TEXT	DB	'VM000000.TMP',0DH

endif

CRLF		DB	2,0DH,0AH

DEBUG_TYPES_SELECTED	DB	-1

if	fg_cv OR fg_td

		PUBLIC	CV_HEADER

		ALIGN	4

CV_HEADER	DB	'NB',14 DUP(-1)

endif

ife	fgh_win32
		PUBLIC	SHARE_ANDER,DOS_VERSION,DOSCALL_EAX,OLD_DTA,OLD_DTA_SEG

SHARE_ANDER	DB	-1
DOS_VERSION	DB	0
		DW	0
DOSCALL_EAX	DD	0
OLD_DTA		DD	0
OLD_DTA_SEG	DD	0

endif

		ALIGN	4

if	fg_segm OR fg_norm_exe

		PUBLIC	EXEHEADER
EXEHEADER	EXE	<5A4DH,20H,0,0,2,0,-1,0,0,0,0,0,EXE._EXE_FIRST_RELOC,0,0>

endif

if	fg_segm
		PUBLIC	NEXEHEADER,STUBPATH_LIST,STUB_LIST,OLD_LIST,RC_LIST,DEFFILE,IMPMOD_HASH_TABLE_PTR

		ALIGN	4

NEXEHEADER	NEXE	<'EN',(10+RELEASE_NUM/256)+ 100H*(RELEASE_NUM AND 0FFH)>

endif

if	fg_pe
		PUBLIC	PEXEHEADER

		ALIGN	4

PEXEHEADER	PEXE	<'EP',0,PEXE_80386,0,0,0,0,SIZE PEXE - PEXE._PEXE_MAJIC,0,10BH,RELEASE_NUM/256,RELEASE_NUM AND 0FFH>

endif

		.DATA?

if	fgh_dosx

		PUBLIC	SEG_RELEASED_256K,SEG_RELEASED_128K

SEG_RELEASED_256K	DD	?
SEG_RELEASED_128K	DD	?

endif

ZERO_BYTES	DD	?


		PUBLIC LAST_MODULE_GINDEX_EXT
LAST_MODULE_GINDEX_EXT	DD	?


COMDAT_VARS	LABEL	BYTE

COMDAT_ATTRIB	DB	?		;*
COMDAT_ALIGN	DB	?		;*
COMDAT_FLAGS	DB	?		;*
COMDAT_TYPE	DB	?		;*

COMDAT_OFFSET	DD	?
COMDAT_CV	DD	?

MYCOMDAT_LINDEX		DD	?
COMDAT_SEGMOD_LINDEX	DD	?
COMDAT_SEGMOD_GINDEX	DD	?
COMDAT_PARENT_SEGMOD_GINDEX	DD	?
COMDAT_DATA_PTR		DD	?
CODE_16_SEG_LEN		DD	?
DATA_16_SEG_LEN		DD	?
CODE_32_SEG_LEN		DD	?
DATA_32_SEG_LEN		DD	?
COMDAT_CODE_16_SEGMENT_GINDEX	DD	?
COMDAT_DATA_16_SEGMENT_GINDEX	DD	?
COMDAT_CODE_32_SEGMENT_GINDEX	DD	?
COMDAT_DATA_32_SEGMENT_GINDEX	DD	?
COMDAT_GROUP_LINDEX	DD	?
COMDAT_GINDEX		DD	?

COMDAT_REF_FLAGS	DB	?
SYMBOL_TABLE_USE	DB	?
MDB_TABLE_USE		DB	?
MEMORY_MODEL		DB	?

LAST_EXTDEF_GINDEX	DD	?
LAST_PUBDEF_GINDEX	DD	?

ENTRYPOINT_GINDEX	DD	?
ENTRYPOINT_TXT		DD	?

ME_PTR			DD	?	;MY FILENAME IN ENVIRONMENT
ME_PATH_LEN		DD	?
DOSX_HDR_SIZE		DD	?

GROUP_PTRS		DD	20 DUP(?)
GROUP_PTRS_PTR		DD	?
GROUP_COUNT		DD	?

HOST_BASE		DD	?

CURN_C_TIME		DD	?		;# OF SECONDS SINCE SOMETHING...

CURN_TIME_DWD		DD	?
CURN_DATE_DWD		DD	?

CURN_YEAR		DW	?
CURN_MONTH		DB	?
CURN_DAY		DB	?

CURN_HOUR		DB	?
CURN_MINUTE		DB	?
CURN_SECOND		DB	?
CURN_HUNDREDTH		DB	?

CURN_SEGMOD_GINDEX	DD	?

SOFT_SEGM	DD	?
STD_ALLOC_OFF	DD	?	;**
STD_ALLOC_LOG	DD	?	;**

NEXT_COMDAT_SEGNUM	DD	?
CIRCULAR_COUNT		DD	?

COMM_TYPE		DB	?
COMM_NUMBER		DB	?
			DW	?

COMM_SIZE_A		DD	?
COMM_SIZE_B		DD	?


		DD	?
FINAL_RANGES	DD	20 DUP(?)		;MAX 10 RANGES-IN-PROGRESS

;
;****  THESE MEMORY BLOCKS MUST BE RELEASED UPON CANCELLATION...
;
			DD	?			;I THINK THIS IS FOR SOME BUG WITH FINAL_TABLE
FINAL_TABLE		DD	40 DUP(?)		;MAX 20 PAGES-IN-PROGRESS

CURN_DICT_LOG		DD	?
RELOC_BITS_LOG		DD	?
if	fg_td
TD_IMPMOD_NAME		DD	?
TD_NAME_HASH_PHYS	DD	?
TD_GTYPE_HASH_LOG	DD	?
TD_GSMEM_HASH_LOG	DD	?
endif
if	fg_cv
CV_INDEX_TABLE	DD	1K/4/(PAGE_SIZE/(1K)) DUP(?)	;256K WORTH OF INDEX ENTRIES...
endif

;THIS STUFF IS UNINITIALIZED
;***************************
FILNAM		NFN_STRUCT	<>
INDNAM		NFN_STRUCT	<>

SRCNAM		NFN_STRUCT	<>

		PUBLIC	LIB_HEADER

LIB_HEADER	DB	16 DUP(?)		;FOR READING LIBRARY HEADER

FLOAT_FLAG	DB	?	;**
FLOAT_TYPE	DB	?	;**

CURN_TYPE		DB	?	;
			DB	?	;AVAIL

		ALIGN	4

FORREF_TYPE	DD	?

if	exepack_support
		PUBLIC	EXEPACK_TEMP,EXEPACK_DANGLE_LEN,EXEPACK_BYTES,EXEPACK_SRC,EXEPACK_ROUTINE,EXEPACK_AX_SAVE,EXEPACK_DI_SAVE
		PUBLIC	EXEPACK_LIMIT,EXEPACK_SEGMENT_START,EXEPACK_TAIL_LIMIT,PACK_REPT_COUNT,PACK_SO_FAR,TARG_ADDR,EXEPACK_ZEROS

.DATA

		ALIGN	4

EXEPACK_TAIL_LIMIT	DD	7

.DATA?
		ALIGN	4

EXEPACK_TEMP	DB	32 DUP(?)

EXEPACK_BYTES		DD	?	;# OF SOURCE BYTES LEFT
EXEPACK_DANGLE_LEN	DD	?	;# OF BYTES LEFT DANGLING
EXEPACK_SRC		DD	?	;SOURCE ADDRESS
EXEPACK_ROUTINE		DCA	?	;PLACE TO RETURN TO
EXEPACK_AX_SAVE		DD	?
EXEPACK_DI_SAVE		DD	?
EXEPACK_LIMIT		DD	?
EXEPACK_SEGMENT_START	DD	?

PACK_REPT_COUNT		DD	?	;...
PACK_SO_FAR		DD	?	;...
TARG_ADDR		DD	?
EXEPACK_ZEROS		DD	?


endif

if	fg_pe

		PUBLIC	PE_OBJECT_ALIGN,PE_FIRST_OBJECT_RVA,LOWEST_ORDINAL,HIGHEST_ORDINAL,PE_BASE,CURN_PE_OBJECT_NUMBER
		PUBLIC	N_EXPORTS,N_EXPORTS_BYNAME,EXPORT_TEXT_SIZE,PE_NEXT_OBJECT_RVA,FIRST_OBJECT_FILE_ADDR,NEXT_OBJECT_FILE_ADDR
		PUBLIC	PE_EXEHDR_START,FORWARDER_TEXT_SIZE,PE_NEXT_SECTION_HDR,N_EXPORT_RVAS,EXPORT_ORDINAL_BASE,EXPORT_RVA_SIZE
		PUBLIC	CURN_PE_OBJECT_GINDEX,N_CODE_DATA_OBJECTS,FIRST_CODE_DATA_OBJECT_GINDEX,NAME_TEXT_SIZE,MODNAM_TEXT_SIZE
		PUBLIC	FIRST_CODE_DATA_OBJECT_NUMBER,PE_IMPORTS_OBJECT_GINDEX,PE_IMPORTS_OBJECT_NUMBER,PE_EXPORTS_OBJECT_NUMBER
		PUBLIC	N_IMPORTS_REFERENCED,N_MODULES_REFERENCED,PE_EXPORTS_OBJECT_GINDEX,ICODE_SEGMOD_GINDEX,ICODE_SM_START
		PUBLIC	ICODE_OS2_FLAGS,ICODE_PEOBJECT_NUMBER,ICODE_PEOBJECT_GINDEX,ICODE_SM_BASE_SEG_GINDEX,PE_THUNKS_RVA
		PUBLIC	PE_RELOC_COUNT,PAGE_RELOC_STUFF,CURN_PAGE_RELOC,PAGE_RELOC_GARRAY,CURN_PAGE_RELOC_GINDEX,tls_CLASS_GINDEX
		PUBLIC	PE_FIXUP_OBJECT_GINDEX,PE_FIXUP_OBJECT_NUMBER,PE_RSRC_OBJECT_GINDEX,PE_RSRC_OBJECT_NUMBER,_tls_used_GINDEX
		PUBLIC	PE_DEBUG_OBJECT_GINDEX,PE_DEBUG_OBJECT_NUMBER,FIRST__IMP__GINDEX,FIRST_PEOBJECT_GINDEX,LAST_PEOBJECT_GINDEX
		PUBLIC	LAST__IMP__GINDEX,IDATA_SEGMOD_GINDEX,LAST_PEOBJECT_NUMBER,FIRST_UNDECORATED_GINDEX,LAST_UNDECORATED_GINDEX
		PUBLIC	GOBJ1_SECT_RAW2_LEN,GOBJ1_SECTION_STUFF
		PUBLIC	FBN_SECT_RAW2_LEN,FBN_SECTION_STUFF
		PUBLIC	DBN_SECT_RAW2_LEN,DBN_SECTION_STUFF

.DATA
		ALIGN	4

PE_OBJECT_ALIGN		DD	1000H
LOWEST_ORDINAL		DD	-1
HIGHEST_ORDINAL		DD	0
PAGE_RELOC_GARRAY	STD_PTR_S <0,0,0,0,PAGE_RELOC_POOL_GET,PAGE_RELOCS_EQU>
;
;COFF Import Library Generation
;
GOBJ1_SECTION_STUFF	DB	'.idata$2'
                        DD	14h,144h,158h,3,0c0100040h
                        DB	'.idata$6'
GOBJ1_SECT_RAW2_LEN	DD	?
                        DD	176h,0,0,0c0200040h

FBN_SECTION_STUFF	DB	'.text',0,0,0
                        DD	6,0B4h,0BAh,1,60201020h
                        DB	'.idata$5'
                        DD	4,0C4h,0C8h,1,0c0301040h
                        DB	'.idata$4'
                        DD	4,0D2h,0D6h,1,0c0301040h
                        DB	'.idata$6'
FBN_SECT_RAW2_LEN	DD	?
                        DD	0E0h,0,0,0c0201040h

DBN_SECTION_STUFF	DB	'.idata$5'
                        DD	4,8Ch,90h,1,0c0301040h
                        DB	'.idata$4'
                        DD	4,09Ah,09Eh,1,0c0301040h
                        DB	'.idata$6'
DBN_SECT_RAW2_LEN	DD	?
                        DD	0A8h,0,0,0c0201040h

.DATA?

		ALIGN	4

FIRST__IMP__GINDEX	DD	?
LAST__IMP__GINDEX	DD	?
FIRST_UNDECORATED_GINDEX DD	?
LAST_UNDECORATED_GINDEX	DD	?
PE_BASE			DD	?
PE_FIRST_OBJECT_RVA	DD	?
PE_NEXT_OBJECT_RVA	DD	?
FIRST_OBJECT_FILE_ADDR	DD	?
NEXT_OBJECT_FILE_ADDR	DD	?
EXPORT_TEXT_SIZE	DD	?
PE_EXEHDR_START		DD	?
FORWARDER_TEXT_SIZE	DD	?
PE_NEXT_SECTION_HDR	DD	?
EXPORT_RVA_SIZE		DD	?
NAME_TEXT_SIZE		DD	?
MODNAM_TEXT_SIZE	DD	?
ICODE_SM_START		DD	?
PE_THUNKS_RVA		DD	?
PE_RELOC_COUNT		DD	?

N_EXPORTS		DD	?
N_EXPORTS_BYNAME	DD	?
N_EXPORT_RVAS		DD	?
EXPORT_ORDINAL_BASE	DD	?
CURN_PE_OBJECT_GINDEX	DD	?
CURN_PE_OBJECT_NUMBER	DD	?
FIRST_CODE_DATA_OBJECT_GINDEX	DD	?
FIRST_CODE_DATA_OBJECT_NUMBER	DD	?
N_CODE_DATA_OBJECTS	DD	?
N_IMPORTS_REFERENCED	DD	?
N_MODULES_REFERENCED	DD	?
PE_IMPORTS_OBJECT_GINDEX	DD	?
PE_EXPORTS_OBJECT_GINDEX	DD	?
PE_FIXUP_OBJECT_GINDEX		DD	?
PE_RSRC_OBJECT_GINDEX		DD	?
PE_DEBUG_OBJECT_GINDEX		DD	?

PE_IMPORTS_OBJECT_NUMBER	DD	?
PE_EXPORTS_OBJECT_NUMBER	DD	?
PE_FIXUP_OBJECT_NUMBER		DD	?
PE_RSRC_OBJECT_NUMBER		DD	?
PE_DEBUG_OBJECT_NUMBER		DD	?
ICODE_SEGMOD_GINDEX	DD	?
ICODE_PEOBJECT_NUMBER	DD	?
ICODE_PEOBJECT_GINDEX	DD	?
ICODE_OS2_FLAGS		DD	?
ICODE_SM_BASE_SEG_GINDEX DD	?

IDATA_SEGMOD_GINDEX	DD	?
CURN_PAGE_RELOC_GINDEX	DD	?

FIRST_PEOBJECT_GINDEX	DD	?
LAST_PEOBJECT_GINDEX	DD	?
LAST_PEOBJECT_NUMBER	DD	?

tls_CLASS_GINDEX	DD	?
_tls_used_GINDEX	DD	?

CURN_PAGE_RELOC		PAGE_RELOC_STRUCT<>

PAGE_RELOC_STUFF	ALLOCS_STRUCT	<>

endif

if	fg_prot
		PUBLIC	FLAG_0C,FLAG_0C_MASK,EXE_DESCRIPTION,CODE_DEFAULTS,CODE_DEFAULTS_MASK,DATA_DEFAULTS,DATA_DEFAULTS_MASK
		PUBLIC	DEF_SEGMENT_GINDEX,SPECIFIC_MASK,SPECIFIC_FLAGS,HEAP_SIZE,EXETYPE_FLAG,SEGMENT_COUNT,FIRST_DIF_SEG_GINDEX,LAST_DIF_SEG_GINDEX
		PUBLIC	SEGMENT_NUMBER,SEGMENT_TABLE,LAST_SEG_OS2_NUMBER,OMF_NAME,EXETYPE_CMDLINE_FLAG

FLAG_0C			DD	?
FLAG_0C_MASK	 	DD	?
EXE_DESCRIPTION		DD	?
CODE_DEFAULTS_MASK	DD	?
DEF_SEGMENT_GINDEX	DD	?

.DATA

CODE_DEFAULTS		DD	0
DATA_DEFAULTS		DD	1

.DATA?

DATA_DEFAULTS_MASK	DD	?
SPECIFIC_MASK		DD	?
SPECIFIC_FLAGS		DD	?
HEAP_SIZE		DD	?

EXETYPE_FLAG		DB	?
EXETYPE_CMDLINE_FLAG	DB	?
			DW	?	;AVAIL

SEGMENT_COUNT		DD	?
FIRST_DIF_SEG_GINDEX	DD	?
LAST_DIF_SEG_GINDEX	DD	?
SEGMENT_NUMBER		DD	?
SEGMENT_TABLE		SEGTBL_STRUCT	512 DUP(<>)	;FOR SEGMENTS...
LAST_SEG_OS2_NUMBER	DD	?
OMF_NAME		DD	?
;DEF_NUMBER		DD	?

endif

ASCIZ			DB	NFN_TEXT_SIZE DUP (?)
ASCIZ_LEN		DD	?
FIRST_FINAL_SEGMENT_GINDEX	DD	?
CURN_OUTFILE_BASE_ADDRESS	DD	?
FIRST_MODULE_GINDEX	DD	?
LAST_MODULE_GINDEX	DD	?
MODULE_COUNT		DD	?
FIRST_MDB_GINDEX	DD	?
LAST_MDB_GINDEX		DD	?
MDB_STRUCT_SIZE		DD	?
EXE_OUT_POSITION	DD	?
CURN_AREA_GINDEX	DD	?
AREA_COUNT		DD	?
SECTION_COUNT		DD	?

CURN_INPTR		DD	?	;**
CURN_COUNT		DD	?	;**
IND_DEVICE		DD	?	;**

FILESTUFF_PTR	DD	?
OBJ_DEVICE	DD	?
;MAX_LIBNUM	DW	?
;LIB_COUNT	DW	?
DICT_BLOCKS	DD	?
CURN_LIB_BLOCK	DD	?
CURN_LIB_BLOCK_PTR_LIMIT	DD	?
CURN_LS_BLOCK_TABLE_PTR		DD	?
LS_MODULE_PTR	DD	?
NUMBLKS		DD	?

CNS_OFFSET	DD	?

FSYMBEG		DD	?
FSYMEND		DD	?

;FSYMBOL_ARRAY	LARRAY_STRUCT<>
;FSYMBOLS	EQU	FSYMBOL_ARRAY
;FSYMBEG 	EQU	FSYMBOLS.FP_BASE
;FSYMEND 	EQU	FSYMBOLS.FP_NEXT
;FSYMLIM 	EQU	FSYMBOLS.FP_LIMIT

FCA_STUFF	DB	SIZE FA_S DUP(?)	;FARCALL FIXUPPS FOR COUNTING RELOCS AND PENTS
;LNA_STUFF	DB	SIZE FA_S DUP(?)
LDA_STUFF	DB	SIZE FA_S DUP(?)	;FIXUPPS, FORREFS, LDATAS, ANYTHING NON-CODE
;GRP_STUFF	DB	SIZE FA_S DUP(?)
DBG_SYM_STUFF	DB	SIZE FA_S DUP(?)	;DEBUG_SYMBOLS, TYPES, LINNUMS
;DBG_TYP_STUFF	DB	SIZE FA_S DUP(?)
COD_STUFF	DB	SIZE FA_S DUP(?)	;FIXUPPS, FORREFS, LDATAS, ANYTHING 'CODE'

OUTFILE_NUMBER		DD	?
FIRST_OUTFILE_GINDEX	DD	?
LAST_OUTFILE_GINDEX	DD	?
LAST_MYCOMDAT_LINDEX	DD	?

.DATA

SYM_HASH		DD	SMALL_SYM_HASH
UNDECO_HASH		DD	PRIME_1K
UNDECO_HASH_PHYS	DD	UNDECO_HASH_TABLE

.DATA?

UNDECO_HASH_TABLE	DD	PRIME_1K DUP(?)

SYM_HASH_LOG		DD	?
SYM_HASH_PHYS		DD	?
SYM_HASH_BLK		DD	?
SYM_HASH_MOD		DD	?
INPTR1			DD	?
LISTTYPE		DD	?
LIB_LIST		FILE_LISTS<>
LIBPATH_LIST		FILE_LISTS<>
OBJ_LIST		FILE_LISTS<>
OBJPATH_LIST		FILE_LISTS<>
LOD_LIST		FILE_LISTS<>
if	fg_segm
STUBPATH_LIST		FILE_LISTS<>
STUB_LIST		FILE_LISTS<>
OLD_LIST		FILE_LISTS<>
RC_LIST			FILE_LISTS<>
DEFFILE			DD	?
endif
ENVIRONMENT_BLOCK	DD	?
FILENAME_HASH_TABLE	DD	FILENAME_HASH_SIZE DUP(?)
VIRDEF_MCD_HASH_TABLE	DD	VIRDEF_MCD_HASH_SIZE DUP(?)
THEADR_HASH_TABLE	DD	THEADR_HASH_SIZE DUP(?)

.DATA

LDATA_TYPE		DB	?
COMMENT_CHAR		DB	'#'
			DW	?	;AVAIL

FILENAME_HASH		DD	FILENAME_HASH_SIZE
FILENAME_HASH_TABLE_PTR	DD	FILENAME_HASH_TABLE
VIRDEF_MCD_HASH		DD	VIRDEF_MCD_HASH_SIZE
VIRDEF_MCD_HASH_TABLE_PTR	DD	VIRDEF_MCD_HASH_TABLE

THEADR_HASH		DD	THEADR_HASH_SIZE	;FOR STORING SRC FILE NAMES PER MODULE FOR DEBUGGING
THEADR_HASH_TABLE_PTR	DD	THEADR_HASH_TABLE

EMS_MAX_1K_BLOCKS	DD	-1
XMS_MAX_1K_BLOCKS	DD	-1

if	page_size EQ 8K

SEGMENT_HASH		DD	PRIME_1K
GROUP_HASH		DD	PRIME_256
MODULE_HASH		DD	PRIME_256
CLASS_HASH		DD	PRIME_256
LOCAL_HASH		DD	PRIME_256

SEGMENT_HASH_TABLE_PTR	DD	0			;FOR GLOBAL SEGMENT SEARCHING
GROUP_HASH_TABLE_PTR	DD	4K			;FOR GLOBAL GROUP SEARCHING
CLASS_HASH_TABLE_PTR	DD	5K			;FOR GLOBAL CLASS SEARCHING
MODULE_HASH_TABLE_PTR	DD	6K			;FOR MODULE-NAME SEARCHING
LOCAL_HASH_TABLE_PTR	DD	7K			;FOR LOCAL SYMBOL SEARCHING

else

SEGMENT_HASH		DD	PRIME_2K
GROUP_HASH		DD	PRIME_512
MODULE_HASH		DD	PRIME_512
CLASS_HASH		DD	PRIME_512
LOCAL_HASH		DD	PRIME_512

SEGMENT_HASH_TABLE_PTR	DD	0
GROUP_HASH_TABLE_PTR	DD	8K
CLASS_HASH_TABLE_PTR	DD	10K
MODULE_HASH_TABLE_PTR	DD	12K
LOCAL_HASH_TABLE_PTR	DD	14K

endif

PACKCODE		DD	65500		;WINDOWS CANNOT ALLOCATE 64K AT ONCE...
PACKDATA		DD	65500		;WINDOWS CANNOT ALLOCATE 64K AT ONCE...
ALIGNMENT		DD	0
SEG_TYPE_MASK_DEFAULT	DB	MASK SEG_RELOC
			DB	?
			DW	?

OPTI_STOSD_SIZE		DD	PAGE_SIZE/4
LOUTALL			DCA	ROOT_RET
IMP_OUTALL		DCA	ROOT_RET


.DATA?

MULTI_HASH_LOG		DD	?
MULTI_HASH_BLK		DD	?
TOKSTR			DD	?
LOCAL_HASH_TABLE_PTR_OLD	DD	?

CURN_SECTION_FILE_ADDRESS	DD	?

OVERLAY_NUMBER		DD	?
SEG_COMBINE		DB	?
SEG_ALIGN		DB	?
SEG32_FLAGS		DB	?
			DB	?

SEG_FRAME		DD	?
SEG_LEN			DD	?
SEG_NAME_LINDEX		DD	?
CLASS_NAME_LINDEX	DD	?
SEG_CLASS_GINDEX	DD	?
GROUP_NAME_LINDEX	DD	?
CLASS_DEBTYP_GINDEX	DD	?
CLASS_DEBSYM_GINDEX	DD	?
CLASS_DEBNAM_GINDEX	DD	?
CLASS_TYPE		DD	?
RECORD_TYPE		DD	?
RECORD_LENGTH		DD	?

FIRST_GROUP_GINDEX	DD	?
LAST_GROUP_GINDEX	DD	?

DGROUP_GINDEX		DD	?
FLAT_GINDEX		DD	?
_TEXT_SEGMENT_GINDEX	DD	?
CODE_CLASS_GINDEX	DD	?
BEGDATA_CLASS_GINDEX	DD	?
BSS_CLASS_GINDEX	DD	?
STACK_CLASS_GINDEX	DD	?
DEBTYP_CLASS_GINDEX	DD	?
DEBSYM_CLASS_GINDEX	DD	?
DEBNAM_CLASS_GINDEX	DD	?

FILE_HASH_MOD		DD	?
RELOC_COUNT		DD	?
TOTAL_RELOCS		DD	?
FIRST_RELOC_GINDEX	DD	?
LAST_RELOC_GINDEX	DD	?
FIXUPP_COUNT		DD	?
SP_SAVE			DD	?

OUT_INIT		DCA	?		;INITIALIZE OUTPUT FILE
OUT_NEW_SEGMENT		DCA	?		;NEW SEGMENT
OUT_NEW_SEGMOD		DCA	?		;NEW SEGMOD
OUT_SEGMOD_FINISH	DCA	?		;END OF A SEGMOD
OUT_SEGMENT_FINISH	DCA	?		;END OF A SEGMENT
OUT_END_OF_SEGMENTS	DCA	?		;END OF ALL SEGMENTS
OUT_FLUSH_SEGMOD	DCA	?		;FLUSH A PARTIAL SEGMENT
OUT_FLUSH_SEGMENT	DCA	?		;FLUSH A SEGMENT WITH RELOCS
OUT_FLUSH_EXE		DCA	?		;LAST RE: OUT_TYPES
OUT_NEW_SECTION		DCA	?
OUT_END_OF_SECTION	DCA	?

OUT_TYPES		EQU	($-OUT_INIT)/4

MAJOR_MOVE_ROUTINE	DCA	?
FORREF_ROUTINE		DCA	?
BOUTALL			DCA	?
OPTI_MOVE		DCA	?	;UPPER/LOWER CASE OR NOT
OPTI_HASH		DCA	?
CASE_STRING_COMPARE	DCA	?

SEG_PAGE_SIZE_M1	DD	?
NOT_SEG_PAGE_SIZE_M1	DD	?
SEG_PAGE_SHIFT		DD	?

CURN_FILE_LIST_GINDEX	DD	?
FIRST_COMMUNAL_GINDEX	DD	?
LAST_COMMUNAL_GINDEX	DD	?
FIRST_VIRDEF_GINDEX	DD	?
LAST_VIRDEF_GINDEX	DD	?
FIRST_COMDAT_GINDEX	DD	?
LAST_COMDAT_GINDEX	DD	?
FIRST_COMDAT_ORDERED_GINDEX	DD	?
LAST_COMDAT_ORDERED_GINDEX	DD	?
RELOC_BITS		DD	?
LIDATA_RELOCS_NEXT	DD	?
LIDATA_RELOCS_START	DD	?
OPTI_RELOC_CLEAR	DD	?
RELOC_HIGH_WATER	DD	?
HIGH_WATER		DD	?
FINAL_HIGH_WATER	DD	?
OLD_HIGH_WATER		DD	?
NEW_REPT_ADDR		DD	?
LAST_SEGMOD_GINDEX	DD	?
CURNMOD_GINDEX		DD	?
CURNMOD_NUMBER		DD	?
CURNLIB_GINDEX		DD	?
SYS_BASE		DD	?
;STACK_DELTA		DD	?
GINPUT_LINE_NUMBER	DD	?

END_OF_RECORD		DD	?
MAX_FINAL_TABLE		DD	?

MAX_FINAL_RANGES	DD	?
LIB_TEMP_WORD		DD	?

EXEHDR_ADDR		DD	?

MAP_DEVICE		DD	?
_EXE_DEVICE		DD	?
IMP_DEVICE		DD	?

HIGH_PC			DD	?
FIRST_STACK_GINDEX	DD	?

LDATA_SEGMOD_GINDEX	DD	?	;FIXUPP&LEDATA
LAST_DATA_PTR		DD	?	;FIXUPP&LEDATA
PREV_DATA_PTR		DD	?	;...
LDATA_LENGTH	 	DD	?	;FIXUPP&LEDATA
LDATA_LOC		DD	?	;FIXUPP&LEDATA

FIRST_SEGMENT_GINDEX	DD	?
LAST_SEGMENT_GINDEX	DD	?
FIRST_CLASS_GINDEX	DD	?
LAST_CLASS_GINDEX	DD	?
_OUTFILE_GINDEX		DD	?
MAPFILE_GINDEX		DD	?
FIRST_LIB_GINDEX	DD	?
LAST_LIB_GINDEX		DD	?
FIRST_REQUEST_LIB_GINDEX	DD	?
LAST_REQUEST_LIB_GINDEX	DD	?
FIRST_WEAK_GINDEX	DD	?
LAST_WEAK_GINDEX	DD	?
FIRST_WEAK_DEFINED_GINDEX	DD	?
LAST_WEAK_DEFINED_GINDEX	DD	?
FIRST_EXTERNAL_GINDEX	DD	?
LAST_EXTERNAL_GINDEX	DD	?
FIRST_ALIASED_GINDEX	DD	?
LAST_ALIASED_GINDEX	DD	?
FIRST_ALIAS_DEFINED_GINDEX	DD	?
LAST_ALIAS_DEFINED_GINDEX	DD	?
FIRST_LAZY_GINDEX	DD	?
LAST_LAZY_GINDEX	DD	?
FIRST_LAZY_DEFINED_GINDEX	DD	?
LAST_LAZY_DEFINED_GINDEX	DD	?
MOD_FIRST_SRC_GINDEX	DD	?
MOD_LAST_SRC_GINDEX	DD	?
SRC_COUNT		DD	?
MOD_FIRST_CSEGMOD_GINDEX	DD	?
MOD_CSEG_COUNT		DD	?
N_MDB_STRUCTS		DD	?
N_SYMBOLS		DD	?

FIRST_COMDAT_SUGGESTED	DD	?	;RECORD DESCRIBING COMDAT ORDERING
LAST_COMDAT_SUGGESTED	DD	?
EXTDEF_DELTA		DD	?
LINNUM_DELTA		DD	?
NULL_TEXT_SEGMOD_GINDEX	DD	?
LIB_MODULES		DD	?
LIB_MODULE_PTR_BLOCKS	DD	?
LIB_MODULE_PTR_LAST_OFFSET	DD	?
MAX_PAGEDWORD		DD	?
CURN_LIB_BLOCK_PTR	DD	?
LS_BLOCK		DD	?
PLINK_LEVEL		DD	?
DONT_PACK		DD	?	;# OF BYTES TO PASS THRU EXE OR SLRPAC
R_DONT_PACK		DD	?
FIRST_FARCALL		DD	?
LAST_FARCALL	 	DD	?
RELOC_CHUNK_COUNT	DD	?
INDIRECT_LEVEL		DD	?

FIRST_CODE_GROUP_GINDEX	DD	?
LAST_CODE_GROUP_GINDEX	DD	?
FIRST_DATA_GROUP_GINDEX	DD	?
LAST_DATA_GROUP_GINDEX	DD	?
FIRST_CODE_SEGMENT_GINDEX	DD	?
FIRST_DATA_SEGMENT_GINDEX	DD	?
LAST_CODE_SEGMENT_GINDEX	DD	?
LAST_DATA_SEGMENT_GINDEX	DD	?
SEGMENT_TABLE_PTR	DD	?
INDIR_TABLE		DD	INDIRECT_NEST_LIMIT+1 DUP(?)	;FOR NESTING @ FILES
FIRST_AREA_GINDEX	DD	?
LAST_SECTION_GINDEX	DD	?
FIRST_SECTION_GINDEX	DD	?
FIRST_SECTION_PLTYPE	DB	?
			DB	?
			DW	?

ERR_NUMBER		DD	?
CURN_OUTFILE_GINDEX 	DD	?
CURN_SECTION_GINDEX 	DD	?
CURN_PLTYPE		DB	?
LAST_DELIM		DB	?
			DW	?

CODEVIEW_SECTION_GINDEX	DD	?
CODEVIEW_PLTYPE		DB	?
LINSYM_FLAGS		DB	?
			DW	?

WM_START_ADDR		DD	?

SEG_SECTION_GINDEX	DD	?
SEG_PLTYPE		DB	?
			DB	?	;AVAIL?
			DW	?

LIN_GROUP_GINDEX	DD	?
LIN_SEGMOD_GINDEX	DD	?

LIN_SRC_GINDEX		DD	?

LIN_SIZE		DD	?
SECTION_NUMBER		DD	?
LAST_FILENAME_GINDEX	DD	?

PUB_FRAME		DD	?	;**
PUB_OFFSET		DD	?	;**
PUB_CV			DD	?	;**
PUB_TYPE		DD	?	;**
PUB_SIZE		DD	?	;**
PUB_GROUP_GINDEX	DD	?	;**
PUB_SEGMOD_GINDEX	DD	?	;**

LIN_LAST_LINNUM		DD	?

PAGEWIDTH		DD	?	;**
PAGELENGTH		DD	?	;**

CV_INFO_TYPE	 	DB	?	;**
CASE_TYPE		DB	?	;**
TD_INFO_TYPE		DB	?	;**
			DB	?	;**

PACK_DEFAULT_SIZE	DD	?	;**

LIB_PAGE_SIZE		DD	?
DICT_OFFSET		DD	?
SELECTED_LIB_COUNT	DD	?
RAINBOW_HASH_MOD	DD	?
DEFAULT_SIZE		DD	?
LNKDIR_PCODE_CV		DD	?
LNKDIR_FLAGS		DB	?
			DB	?
			DW	?

LINNUM_ADDER		DD	?
DOSSEG_STRUC		DB	4*16 DUP(?)
;LIB_USED_SYMBOLS	DD	?
LIB_UNUSED_SYMBOLS_GINDEX	DD	?
TYPDEF_ANDER		DD	?
CURN_LIB_MODULE		DD	?
QN_PTR			DD	?

C_COMMON_SEGMOD_GINDEX	DD	?
FAR_BSS_SEGMOD_GINDEX	DD	?
FORREF_SIZE		DD	?
STACK_SIZE		DD	?
MODEND_OWNER_GINDEX 	DD	?
MODEND_ADDRESS		DD	?

MOD_FIRST_PUBLIC_GINDEX	DD	?

BUFFER_OFFSET		DD	?

LOC_11_FIX		DD	?
LOC_10			DD	?
LOC_CALLTBL_PTR		DD	?

SRCADR			DD	?

_ERR_COUNT		DD	?
WARN_COUNT		DD	?

EDI_SAVE		DD	?
OTHERS_SAVE		DD	6 DUP(?)

LNAME_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)
SEGMOD_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)
GROUP_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)
SYMBOL_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)

LNAME_LARRAY_TBL	DD	256 DUP(?)
SEGMOD_LARRAY_TBL	DW	256 DUP(?)
GROUP_LARRAY_TBL	DW	256 DUP(?)
SYMBOL_LARRAY_TBL	DW	256 DUP(?)

.DATA

		ALIGN	4

LIBRARY_GARRAY		STD_PTR_S <0,0,0,0,TEXT_POOL_GET,LIBRARY_EQU>
CLASS_GARRAY		STD_PTR_S <0,0,0,0,CLASS_POOL_GET,SEGCLASS_EQU>
_FILE_LIST_GARRAY	STD_PTR_S <0,0,0,0,TEXT_POOL_GET,FILES_EQU>
SYMBOL_GARRAY		STD_PTR_S <0,0,0,0,SSYM_POOL_GET,PUBSYMS_EQU>
SEGMENT_GARRAY		STD_PTR_S <0,0,0,0,SEGMENT_POOL_GET,SEGMENTS_EQU>
SEGMOD_GARRAY		STD_PTR_S <0,0,0,0,SEGMOD_POOL_GET,SEGMODS_EQU>
GROUP_GARRAY		STD_PTR_S <0,0,0,0,GROUP_POOL_GET,GROUPS_EQU>
MODULE_GARRAY		STD_PTR_S <0,0,0,0,MODULE_POOL_GET,MODULES_EQU>
OUTFILE_GARRAY		STD_PTR_S <0,0,0,0,TILLP2_POOL_GET,OUTFILES_EQU>
AREA_GARRAY		STD_PTR_S <0,0,0,0,SECTION_POOL_GET,AREAS_EQU>
SECTION_GARRAY		STD_PTR_S <0,0,0,0,SECTION_POOL_GET,SECTIONS_EQU>
CSEG_GARRAY		STD_PTR_S <0,0,0,0,TILLP2_POOL_GET,CSEGS_EQU>
RELOC_GARRAY		STD_PTR_S <0,0,0,0,RELOC_POOL_GET,RELOCS_EQU>
SRC_GARRAY		STD_PTR_S <0,0,0,0,TILLP2_POOL_GET,SRCS_EQU>
MDB_GARRAY		STD_PTR_S <0,0,0,0,MODULE_POOL_GET,MDBS_EQU>


.DATA?

if	debug
			PUBLIC	ALLOCATED_BLOCKS,DISK_IO_COUNT,EMS_IO_COUNT,ALLOCATED_IO_BLOCKS,TYPE_COLLISION_COUNT
			PUBLIC	TYPE_COLLISION_TID,TYPE_COLLISION_MAX

ALLOCATED_BLOCKS	DD	?
ALLOCATED_IO_BLOCKS	DD	?
DISK_IO_COUNT		DD	?
EMS_IO_COUNT		DD	?

TYPE_COLLISION_COUNT	DD	?
TYPE_COLLISION_MAX	DD	?
TYPE_COLLISION_TID	DB	?
			DB	?
			DW	?
endif

CTRL_C_FLAG		DB	?
LAST_CHAR		DB	?
REFERENCE_FLAGS		DB	?
MCD_FLAGS		DB	?

if	any_overlays
			PUBLIC	CLASS_SECTION,CLASS_PLTYPE,VECTOR_COUNT,OVERLAY_INTERRUPT_NUMBER,RELOAD_DEPTH,OVL_LIMIT,FILE_FLAGS
			PUBLIC	VECTOR_TABLE_ADDRESS,SECTION_SIZE,SLR_CODE,SLR_VECTORS,SLR_SECTIONS,SLR_HDR_TABLE,OVERLAY_NUMBER
			PUBLIC	SLR_RELOAD_STACK,VECTOR_SIZE,FILE_SECTION,FILE_PLTYPE,FILE_PLINK_FLAGS,MAX_LEVEL
			PUBLIC	COMPRESS_DEFAULT_BYTE,CACHE_DEFAULT_BYTE,SLR_FNAMES
			PUBLIC	VECTOR_SECTION_FILE_ADDRESS,SECTION_PARAS
			PUBLIC	OVR_INIT_ADDR,SLR_CODE_HEADER,CACHE_BLOCK_COUNT,CACHE_ORDER,OVL_PANIC_PARAS
			PUBLIC	OVL_DELTA_PARAS,DATA_SECTION,DATA_PLTYPE
			PUBLIC	ALLO_LAST_BLOCK,MOD_SECTION,MOD_PLTYPE,END_VECTOR_TABLE,SLR_CODE_CLASS
			PUBLIC	SLR_SCODE_CLASS

.DATA

OVERLAY_INTERRUPT_NUMBER	DW	3FH
COMPRESS_DEFAULT_BYTE	DB	1
CACHE_DEFAULT_BYTE	DB	1

.DATA?

CLASS_SECTION		DD	?
CLASS_PLTYPE		DB	?
			DB	?	;AVAIL

MOD_SECTION		DD	?
MOD_PLTYPE		DB	?
			DB	?	;AVAIL

VECTOR_COUNT	 	DW	?
;RELOAD_TYPE		DW	?
RELOAD_DEPTH 		DW	?
FILE_FLAGS		DW	?
MAX_LEVEL		DW	?	;MAX NESTING LEVEL

VECTOR_TABLE_ADDRESS 	DD	?
END_VECTOR_TABLE	DD	?
SECTION_PARAS		DW	?

OVERLAY_NUMBER		DW	?
SECTION_SIZE 		DW	?	;SIZE OF ENTRY IN SECTION TBL
SLR_CODE		DD	?
SLR_VECTORS		DD	?
SLR_SECTIONS 		DD	?
SLR_HDR_TABLE		DD	?
SLR_FNAMES		DD	?
SLR_RELOAD_STACK	DD	?
SLR_CODE_CLASS		DD	?
SLR_SCODE_CLASS		DD	?
VECTOR_SIZE		DW	?
FILE_SECTION	 	DD	?
FILE_PLTYPE		DB	?
FILE_PLINK_FLAGS	DB	?
VECTOR_SECTION_FILE_ADDRESS	DD	?
;OVR_EXTRN_END		DW	?
OVR_INIT_ADDR		DD	?	;ADDR OF OVR_INIT SYMBOL
SLR_CODE_HEADER		DD	?
CACHE_BLOCK_COUNT	DW	?
CACHE_ORDER		DW	?	;

OVL_LIMIT		DW	?
OVL_PANIC_PARAS		DW	?	;
OVL_DELTA_PARAS		DW	?	;
DATA_SECTION	 	DD	?
DATA_PLTYPE		DB	?
			DB	?	;AVAIL
ALLO_LAST_BLOCK		DW	?

endif

if	fg_plink

			PUBLIC	PLINK_SPSAVE,PL_DFLT_RADIX,PL_COUNT,PAGE_HEIGHT,PAGE_WIDTH,NAME_WIDTH,WORKFILE,MAP_FLAGS

.DATA

PL_DFLT_RADIX		DW	16

.DATA?

PLINK_SPSAVE	 	DW	?
PL_COUNT		DW	?
PAGE_HEIGHT		DW	?
PAGE_WIDTH		DW	?
NAME_WIDTH		DW	?
WORKFILE		DD	?
MAP_FLAGS		DB	?
			db	?
endif

if	fg_slrpack

		PUBLIC	SLR_PREV_SEG,SLRBUF_PTR,NEXT_AVAIL,NEXT_AVAIL_2,COMPRESS_TABLE,COMPRESS_TABLE_LENGTH,PUTSTUFF_SMALL
		PUBLIC	PUTSTUFF,SLR_FLUSHSTUFF,FIX_BUFFERS,SLR_NEXT_SEG,OLD_MATCHED_COUNT,OLD_OFFSET,SEED_SIZE,SLR2_TABLE
		PUBLIC	SLR_CPOS,SLR_VARS,SLR_DATA,SLR_INBUF_LIMIT,SLR_WORD,SLR_HASHES_BASE,SLR_DICTIONARY_BASE,SLR_STRUCT_BASE
		PUBLIC	SLR_SCAN_LIMIT,DEL_INST_COUNT,SLR_DICT_COUNT,SLR_DICT2_COUNT,PUTBYTE_ADDR1,PUTBYTE_ADDR2,PUTBYTE_TEMP
		PUBLIC	SLR_MASK,SLR_BYTES_LEFT,SLR_TMP_PTR,SLR_INPUT_PTR_BASE,SLR_INPUT_PTR_OFFSET,HUF_PUT_PTR,HASH_TABLE2_OFFSET
		PUBLIC	HUF_MINI_BUFFER


SLR_PREV_SEG		DD	?
SLR_NEXT_SEG		DD	?
OLD_MATCHED_COUNT	DD	?
OLD_OFFSET		DD	?
SLRBUF_PTR		DD	?
SLR_BYTES_LEFT		DD	?
SLR_TMP_PTR		DD	?
SLR_INPUT_PTR_OFFSET	DD	?
SLR_INPUT_PTR_BASE	DD	?
SLR_HASHES_BASE		DD	?
SLR_DICTIONARY_BASE	DD	?
SLR_STRUCT_BASE		DD	?
HUF_PUT_PTR		DD	?
NEXT_AVAIL		DD	?
NEXT_AVAIL_2		DD	?
SLR_CPOS		DD	?
SLR_VARS		DD	?
SLR_DATA		DD	?
SLR_INBUF_LIMIT		DD	?
SLR_WORD		DD	?
SLR_MASK		DD	?
SLR_SCAN_LIMIT		DD	?
DEL_INST_COUNT		DD	?
SLR_DICT_COUNT		DD	?
SLR_DICT2_COUNT		DD	?
PUTBYTE_ADDR1		DD	?
PUTBYTE_ADDR2		DD	?
PUTBYTE_TEMP		DD	?
SEED_SIZE		DD	?

COMPRESS_TABLE		LABEL	WORD
PUTSTUFF_SMALL		DD	?
PUTSTUFF		DD	?
SLR_FLUSHSTUFF		DD	?
FIX_BUFFERS		DD	?
COMPRESS_TABLE_LENGTH	EQU	$-COMPRESS_TABLE

HASH_TABLE2_OFFSET	DD	HTW2_SIZE DUP(?)
SLR2_TABLE		DB	256 * SIZE SLR2_STRUCT DUP(?)
HUF_MINI_BUFFER 	DB	HMB_SIZE DUP(?)

endif

if	alloc_support

		PUBLIC	PUBALLOC_STUFF,LIBALLOC_STUFF

PUBALLOC_STUFF		ALLOCS_STRUCT	<>
LIBALLOC_STUFF		ALLOCS_STRUCT	<>
endif

LNAME_STUFF		ALLOCS_STRUCT	<>		;USED FOR TEMPORARY STORAGE OF LNAME TEXTS, ETC, ALLOC_LOCAL
RELOC_STUFF		ALLOCS_STRUCT	<>		;

SSYM_STUFF		ALLOCS_STRUCT	<>		;SYMBOL TABLE,'HUGE' INFO, PTRS TO RESOURCE BLOCKS
P1ONLY_STUFF		ALLOCS_STRUCT	<>		;ORDERING INFO FOR COMDATS, REFERENCES FOR COMDATS, LIBRARY STRUCTURES
TILLMIDDLE_STUFF	ALLOCS_STRUCT	<>		;LOCAL SYMBOLS, 'HUGE' INFO, MODULES
;TILLP2_STUFF		ALLOCS_STRUCT	<>		;CVPACK FILENAME, CSEG, SRC, OUTFILE, START_ADDRESS,MODULE_NAME,DESCRIPTION
SEGMENT_STUFF		ALLOCS_STRUCT	<>
;SEGMOD_STUFF		ALLOCS_STRUCT	<>		;SEGMODS - SEGMENT_STUFF
;MODULE_STUFF		ALLOCS_STRUCT	<>		;HASHED MODULES - SEGMENT_STUFF
;GROUP_STUFF		ALLOCS_STRUCT	<>		;GROUPS - SEGMENT_STUFF
;CLASS_STUFF		ALLOCS_STRUCT	<>		;CLASSES - SEGMENT_STUFF
;SECTION_STUFF		ALLOCS_STRUCT	<>		;SECTIONS, AREAS - SEGMENT_STUFF
;TEXT_STUFF		ALLOCS_STRUCT	<>		;FILENAMES,LIBRARIES - SEGMENT_STUFF

XREF_STUFF		ALLOCS_STRUCT	<>
UNMANGLE_STUFF		ALLOCS_STRUCT	<>

LOCKED_STUFF		LKD_ALLOC_STRUCT<>

		ALIGN	4

OUTBUF		DB	INBUF_LEN*2 DUP (?)
INBUF		DB	INBUF_LEN DUP (?)
;		DW	1A1AH
;INBUFO 	DB	INBUF_LEN DUP(?)	;FOR NESTING INTO @ FILE


if	fgh_dpmi

		PUBLIC	PHYS_TABLE,OLD_GP_FAULT,STARTING_SP,OLD_GP_FAULT_HI,PMODE,PHYS_IO_TEMP,DOS_SELECTORS,MAX_DOS_SELECTOR

PHYS_TABLE	DW	4 DUP(?)
PHYS_IO_TEMP	DW	2 DUP(?)

OLD_GP_FAULT	DD	?
OLD_GP_FAULT_HI	DW	?
PMODE		DW	?
STARTING_SP	DW	?

DOS_SELECTORS	DW	64*16/(PAGE_SIZE/1024) DUP(?)

		.DATA

MAX_DOS_SELECTOR	DW	DOS_SELECTORS

		.DATA?
endif

if	fgh_win

		PUBLIC	HPREV,CMDSHOW,PHYS_TABLE

PHYS_TABLE	DW	4 DUP(?)
HPREV		DW	?
CMDSHOW		DW	?

endif


if	fgh_anythreads

		PUBLIC	GLOBALALLOC_SEM,_SAY_VERBOSE_SEM,ERROR_SEM,GLOBAL_SEMAPHORE_LIST,GLOBAL_SEMAPHORE_COUNT
		PUBLIC	OOM_ERROR_SEM,_ABORTER_SEM

if	fgh_outhreads
		PUBLIC	OUTPUT_DEVICE_LIST_SEM
endif

if	fgh_mapthread
		PUBLIC	PUBS_DEFINED_SEM,START_DEFINED_SEM,XREF_OK_SEM,MAPLINES_OK_SEM,MAP_THREAD_ID,MAP_THREAD_HANDLE
		PUBLIC	SEGS_ORDERED_SEM,PUT_DATA_SEM,EXPS_DEFINED_SEM
endif

if	fgh_inthreads
		PUBLIC	NONRES_LENGTH,_NONRES_LENGTH_SEM,LIB_ORDER_SEM,LIB_THREAD_LOCALS,RES_LENGTH
		PUBLIC	THREAD_LOCALS,LAST_FILENAME_OPENED,LIB_REQUEST_ORDER_SEM
endif

		.DATA?

		ALIGN	4

GLOBAL_SEMAPHORE_LIST	LABEL	QWORD

if	fgh_inthreads
_NONRES_LENGTH_SEM	GLOBALSEM_STRUCT	<>
LIB_ORDER_SEM		GLOBALSEM_STRUCT	<>
LIB_REQUEST_ORDER_SEM	GLOBALSEM_STRUCT	<>
;STUB_OLD_DONE_SEM	GLOBALSEM_STRUCT	<>	;NO LONGER A SEPARATE THREAD...
endif

if	fgh_mapthread
SEGS_ORDERED_SEM	GLOBALSEM_STRUCT	<>
PUBS_DEFINED_SEM	GLOBALSEM_STRUCT	<>
START_DEFINED_SEM	GLOBALSEM_STRUCT	<>
XREF_OK_SEM		GLOBALSEM_STRUCT	<>
MAPLINES_OK_SEM		GLOBALSEM_STRUCT	<>
PUT_DATA_SEM		GLOBALSEM_STRUCT	<>
EXPS_DEFINED_SEM	GLOBALSEM_STRUCT	<>
_SAY_VERBOSE_SEM		GLOBALSEM_STRUCT	<>
endif

GLOBALALLOC_SEM		GLOBALSEM_STRUCT	<>
ERROR_SEM		GLOBALSEM_STRUCT	<>
OOM_ERROR_SEM		GLOBALSEM_STRUCT	<>
_ABORTER_SEM		GLOBALSEM_STRUCT	<>

if	fgh_outhreads
OUTPUT_DEVICE_LIST_SEM	GLOBALSEM_STRUCT	<>
endif

GLOBAL_SEMAPHORE_COUNT	EQU	($-GLOBAL_SEMAPHORE_LIST)/SIZE GLOBALSEM_STRUCT

if	fgh_inthreads

LAST_FILENAME_OPENED	DD	?

THREAD_LOCALS		DD	N_R_THREADS DUP(?)
LIB_THREAD_LOCALS	DD	N_R_THREADS DUP(?)

NONRES_LENGTH		DD	?
RES_LENGTH		DD	?

endif

if	fgh_mapthread

MAP_THREAD_ID		DD	?
MAP_THREAD_HANDLE	DD	?

endif

endif


if fg_cv

		PUBLIC	CV_INDEX_TABLE,CV_HEADER_LOC,CV_INDEX_BLK,CV_INDEX_PTR,CV_INDEX_BLK_PTR,CV_INDEX_COUNT,CV_INDEX_TEMP
		PUBLIC	CV_TYPE,CVPACK_ADDR,CVPACK_PID,MOD_CV_TYPES_SEGMOD,MOD_CV_SYMBOLS_SEGMOD,CV_NUL_SYMBOLS_SEGMOD
		PUBLIC	BYTES_SO_FAR,CV_TEMP_RECORD,LAST_CV_MODULE_GINDEX,CV_NUL_TYPES_SEGMOD,MOD_CV_NAMES_SEGMOD
		PUBLIC	CURN_TYPE_MODULE,CURN_SYMBOL_MODULE,CURN_TYPE_SEGMOD_GINDEX,CURN_SYMBOL_SEGMOD_GINDEX,CV_HEADER_LOC_PHYS
		PUBLIC	CV_NUL_NAMES_SEGMOD,CV_SEGMENT_COUNT,CV_GROUP_COUNT,FIRST_NAMESP_GINDEX,LAST_NAMESP_GINDEX,CV_LIB_COUNT
		PUBLIC	FIRST_CV_SEGMENT_GINDEX,LAST_CV_SEGMENT_GINDEX,FIRST_CV_GROUP_GINDEX,LAST_CV_GROUP_GINDEX
		PUBLIC	FIRST_CV_LIB_GINDEX,LAST_CV_LIB_GINDEX

		.DATA?

CV_TEMP_RECORD	DB	CV_TEMP_SIZE DUP(?)

CV_HEADER_LOC		DD	?
CV_INDEX_BLK_PTR	DD	?
CV_INDEX_BLK		DD	?
CV_INDEX_PTR		DD	?
CV_INDEX_COUNT		DD	?
CV_INDEX_TEMP		DB	12 DUP(?)

;CV_LIN_PHYS		DW	?
;CV_LIN_BLK		DW	?
;CV_LN_STUFF		DB	SIZE LINNUM_HEADER_TYPE DUP(?)
;CV_MOD_STUFF	 	DB	SIZE MODULE_STRUCT DUP(?)
;CV_LINNUM_COUNT		DW	?
;CV_LINNUM_COUNT_ADDR	DD	?
;CV_LAST_GROUP		DD	?
;CV_LAST_SEGMOD		DD	?
;CV_FRAME		DW	?
;CV_LN_FACTOR	 	DW	?
CURNLIB_NUMBER		DD	?
BYTES_SO_FAR		DD	?
LAST_CV_MODULE_GINDEX	DD	?
CVPACK_ADDR		DD	?		;ADDRESS OF VALID CVPACK.EXE TEXT

CURN_TYPE_SEGMOD_GINDEX	DD	?	;**
CURN_TYPE_MODULE	DD	?	;**

CURN_SYMBOL_SEGMOD_GINDEX	DD	?	;**
CURN_SYMBOL_MODULE	DD	?	;**

CV_TYPE			DD	?
CVPACK_PID		DD	?

CV_SEGMENT_COUNT	DD	?
CV_GROUP_COUNT		DD	?
FIRST_CV_SEGMENT_GINDEX	DD	?
LAST_CV_SEGMENT_GINDEX	DD	?
FIRST_CV_GROUP_GINDEX	DD	?
LAST_CV_GROUP_GINDEX	DD	?
FIRST_NAMESP_GINDEX	DD	?
LAST_NAMESP_GINDEX	DD	?
CV_LIB_COUNT		DD	?
FIRST_CV_LIB_GINDEX	DD	?
LAST_CV_LIB_GINDEX	DD	?

;ADJUST_SEGMOD		DD	?Z	;
CV_HEADER_LOC_PHYS	DD	?

MOD_CV_TYPES_SEGMOD	DD	?
MOD_CV_SYMBOLS_SEGMOD	DD	?
MOD_CV_NAMES_SEGMOD	DD	?
CV_NUL_TYPES_SEGMOD	DD	?
CV_NUL_SYMBOLS_SEGMOD	DD	?
CV_NUL_NAMES_SEGMOD	DD	?

endif

if	fg_cvpack

		PUBLIC	CV_LTYPE_GARRAY,GSYM_HASH,GSYM_HASH_LOG,CV_GSYM_GARRAY,CV_GSYM_STUFF,CV_ASYM_STRUCTURE
		PUBLIC	CV_REFSYM_CNT,CV_LTYPE_STUFF,CVG_SYMBOL_HASH,CVG_SYMBOL_OFFSET,CVG_SEGMENT_OFFSET
		PUBLIC	CVG_SEGMENT,CV_GTYPE_GARRAY,CV_GTYPE_HASH_LOG,CV_GTYPE_HASH,CV_GTYPE_STUFF
		PUBLIC	SSYM_HASH_LOG,SSYM_HASH,FIRST_GSYM_GINDEX,LAST_GSYM_GINDEX,FIRST_SSYM_GINDEX,LAST_SSYM_GINDEX,CV_SSYM_GARRAY
		PUBLIC	CV_SSYM_STUFF,LAST_CVH_SEGMENT,CV_HASHES_STUFF,CV_HASHES_GARRAY
		PUBLIC	CV_LTYPE_SPECIAL_BLOCK,CV_LTYPE_OVERSIZE_CNT
		PUBLIC	CV_GTYPE_SPECIAL_BLOCK,CV_GTYPE_OVERSIZE_CNT
    .DATA

		ALIGN	4

GSYM_HASH	DD	SMALL_SYM_HASH
SSYM_HASH	DD	SMALL_SYM_HASH
CV_GTYPE_HASH	DD	SMALL_SYM_HASH

CV_GTYPE_GARRAY		STD_PTR_S<0,0,0,0,CV_GTYPE_POOL_GET,CVGTYPES_EQU>
CV_GSYM_GARRAY		STD_PTR_S<0,0,0,0,CV_GSYM_POOL_GET,CVGSYMS_EQU>
CV_SSYM_GARRAY		STD_PTR_S<0,0,0,0,CV_SSYM_POOL_GET,CVSSYMS_EQU>
CV_LTYPE_GARRAY		STD_PTR_S<0,0,0,0,CV_LTYPE_POOL_GET,CVLTYPES_EQU>
CV_HASHES_GARRAY	STD_PTR_S<0,0,0,0,CV_HASHES_POOL_GET,CVHASHES_EQU>


.DATA?

CV_GSYM_STUFF	ALLOCS_STRUCT	<>
CV_SSYM_STUFF	ALLOCS_STRUCT	<>
CV_LTYPE_STUFF	ALLOCS_STRUCT	<>
CV_GTYPE_STUFF	ALLOCS_STRUCT	<>
CV_HASHES_STUFF	ALLOCS_STRUCT	<>

CV_LTYPE_OVERSIZE_CNT	DD	?
CV_LTYPE_SPECIAL_BLOCK	DD	?

CV_GTYPE_OVERSIZE_CNT	DD	?
CV_GTYPE_SPECIAL_BLOCK	DD	?

;CV_SSEARCH_PARRAY	PAR_PTR_S<>
;CV_STATICSYM_PARRAY	PAR_PTR_S<>
;CV_HASHES_PARRAY	PAR_PTR_S<>
;CV_LFWD_PARRAY		PAR_PTR_S<>

CV_ASYM_STRUCTURE	SEQ_STRUCT<>
endif

if	fg_cvpack AND fg_pe
			ORG CV_ASYM_STRUCTURE
else if fg_pe
.DATA
endif

if	fg_pe

                PUBLIC  COFF_HELPERS_STRUCTURE
COFF_HELPERS_STRUCTURE	SEQ_STRUCT<>
endif
if	fg_cvpack
			DD	1K/(PAGE_SIZE/1024) DUP(?)

GSYM_HASH_LOG		DD	?
SSYM_HASH_LOG		DD	?
CV_REFSYM_CNT		DD	?
CV_GTYPE_HASH_LOG	DD	?
LAST_CVH_SEGMENT	DD	?

CVG_SYMBOL_OFFSET	DD	?
CVG_SYMBOL_HASH		DD	?
CVG_SEGMENT_OFFSET	DD	?
CVG_SEGMENT		DD	?

FIRST_GSYM_GINDEX	DD	?
LAST_GSYM_GINDEX	DD	?
FIRST_SSYM_GINDEX	DD	?
LAST_SSYM_GINDEX	DD	?

endif
if	fg_td

		PUBLIC	TD_HEADER_LOC,TD_GLOBAL_BASE,TD4_HEADER,TD3_HEADER,TD_SYMBOL_PARRAY,TD_NAME_HASH,TD_NAME_HASH_PHYS
		PUBLIC	TD_NAME_GARRAY32,TD_NAME_STUFF,TD_MAJOR,TD_MINOR,TD_CURRENT_SCOPE,MOD_TD_COMP_PARAMS,MOD_PREV_CSEGS
		PUBLIC	MOD_TD_OPTFLAGS,MOD_TD_FIRST_LOCAL,TD_LSCOPE_PARRAY,TD_N_OPTSYMS,TD_N_GSCOPES,TD_N_LSCOPES,TD_OPTSYM_PARRAY
		PUBLIC	TD_GSCOPE_PARRAY,TD_GLOCAL_GARRAY32,TD_GLOCAL_STUFF,MOD_TD_LOCALS_INDEX32,MOD_TD_LOCALS_COUNT,MOD_TD_FIRST_CLASS
		PUBLIC	TD_OPTIMIZATIONS_FLAG,TD_LSRC_PARRAY,TD_MODULES_BASE,TD_SRCFILES_BASE,TD_N_CORRELATIONS,TD_N_LINES
		PUBLIC	TD_CORRELATIONS_PARRAY,TD_SCOPES_BASE,TD_COUNT_CSEGS,TD_OUTER_SCOPE,TD_LAST_COVERAGE,TD_COVERAGE_PARRAY
		PUBLIC	TD_N_COVERAGES,TD_COVERAGE_MAP_BASE,TD_LTYPE_GARRAY,TD_SMEM_STARTING_INDEX,TD_LCLASS_GARRAY,TD_GTYPE_HASH
		PUBLIC	TD_GTYPE_HASH_PHYS,TD_GTYPE_GARRAY32,TD_GTYPE_STUFF,TD_SMEM_RUNNING_HASH,TD_SMEM_RUNNING_COUNT,TD_GSMEM_HASH
		PUBLIC	TD_LSMEM_GARRAY,TD_GSMEM_HASH_PTR,TD_GCLASS_HASH,TD_GCLASS_HASH_PTR,TD_GSMEM_GARRAY32,TD_GCLASS_GARRAY
		PUBLIC	TD_GTYPE_HASH_LOG,TD_GTYPE_HASH_BLK,TD_GSMEM_HASH_LOG,TD_GSMEM_HASH_BLK,TD_GSMEM_STUFF,TD_GCLASS_STUFF
		PUBLIC	MATCHED_BUFFER,LAST_TD_MATCHED,MATCHED_COUNT,MATCHED_PTR,FIRST_WEP_GINDEX,TD_IMPMOD_NAME


		.DATA?

TD_HEADER_LOC		DD	?
TD_GLOBAL_BASE		DD	?
TD_MODULES_BASE		DD	?
TD_SRCFILES_BASE	DD	?
TD_SCOPES_BASE		DD	?
TD_COVERAGE_MAP_BASE	DD	?

TD_GTYPE_HASH_PHYS	DD	?
TD_GTYPE_HASH_BLK	DD	?
TD_GSMEM_HASH_BLK	DD	?
TD_GSMEM_HASH_PTR	DD	?
TD_GCLASS_HASH_PTR	DD	?

TD_MAJOR		DB	?
TD_MINOR		DB	?
			DW	?

TD_N_LSCOPES		DD	?
TD_N_OPTSYMS		DD	?
TD_N_GSCOPES		DD	?
TD_N_CORRELATIONS	DD	?
TD_N_COVERAGES		DD	?
TD_N_LINES		DD	?
TD_COUNT_CSEGS		DD	?
TD_CURRENT_SCOPE	DD	?
TD_OUTER_SCOPE		DD	?
TD_SMEM_STARTING_INDEX	DD	?
TD_SMEM_RUNNING_COUNT	DD	?
TD_SMEM_RUNNING_HASH	DD	?
TD_OPTIMIZATIONS_FLAG	DD	?
MOD_TD_COMP_PARAMS	DD	?
MOD_PREV_CSEGS		DD	?
MOD_TD_LOCALS_INDEX32	DD	?
MOD_TD_LOCALS_COUNT	DD	?
MOD_TD_OPTFLAGS		DD	?
MOD_TD_FIRST_LOCAL	DD	?
MOD_TD_FIRST_CLASS	DD	?
TD_LAST_COVERAGE	DD	?
FIRST_WEP_GINDEX	DD	?

MATCHED_COUNT		DD	?
MATCHED_PTR		DD	?
LAST_TD_MATCHED		DD	?

MATCHED_BUFFER		DD	16 DUP(?)

TD4_HEADER		TD4_HEADER_STRUCT<>
TD3_HEADER		TD3_HEADER_STRUCT<>

TD_NAME_GARRAY32	STD32_PTR_S<>
TD_GTYPE_GARRAY32	STD32_PTR_S<>
TD_GSMEM_GARRAY32	STD32_PTR_S<>
TD_GLOCAL_GARRAY32	STD32_PTR_S<>

;TD_GLOCAL_GARRAY32	STD_PTR_S<0,0,0,0,TD_GLOCAL_POOL_GET,TDLOCALS_EQU>

TD_NAME_STUFF		ALLOCS_STRUCT<>
TD_GLOCAL_STUFF		ALLOCS_STRUCT<>
TD_GTYPE_STUFF		ALLOCS_STRUCT<>
TD_GSMEM_STUFF		ALLOCS_STRUCT<>
TD_GCLASS_STUFF		ALLOCS_STRUCT<>

TD_SYMBOL_PARRAY	PAR_PTR_S<>
TD_LSCOPE_PARRAY	PAR_PTR_S<>
TD_GSCOPE_PARRAY	PAR_PTR_S<>
TD_OPTSYM_PARRAY	PAR_PTR_S<>
TD_LSRC_PARRAY		PAR_PTR_S<>
TD_COVERAGE_PARRAY	PAR_PTR_S<>

TD_CORRELATIONS_PARRAY	EQU	TD_LSCOPE_PARRAY

PARALLELS		SEGMENT	WORD PUBLIC	'DATA'

			DD	TD_SYMBOL_PARRAY
			DD	TD_LSCOPE_PARRAY
			DD	TD_GSCOPE_PARRAY
			DD	TD_OPTSYM_PARRAY
			DD	TD_LSRC_PARRAY
			DD	TD_COVERAGE_PARRAY

PARALLELS		ENDS

.DATA

		ALIGN	4

TD_GCLASS_GARRAY	STD_PTR_S<0,0,0,0,TD_GCLASS_POOL_GET,TDCLASSES_EQU>
TD_LTYPE_GARRAY		STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLTYPES_EQU>
TD_LCLASS_GARRAY	STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLCLASSES_EQU>
TD_LSMEM_GARRAY		STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLMEMBERS_EQU>

.DATA

if	PAGE_SIZE EQ 8K

SYM_SHIFTS	EQU	300H+10
SYM_MASK	EQU	3FFH
SYM_BLK_CNT	EQU	64
TD_NAME_HASH	DD	PRIME_2K
TD_GTYPE_HASH	DD	PRIME_2K

TD_GSMEM_HASH	DD	PRIME_1K
TD_GCLASS_HASH	DD	PRIME_2K

else

SYM_SHIFTS	EQU	300H+11
SYM_MASK	EQU	7FFH
SYM_BLK_CNT	EQU	32
TD_NAME_HASH	DD	PRIME_4K
TD_GTYPE_HASH	DD	PRIME_4K

TD_GSMEM_HASH	DD	PRIME_2K
TD_GCLASS_HASH	DD	PRIME_4K

endif


.DATA?
endif

if	fg_xref
		PUBLIC	XREF_PTR,FIRST_XREF_BLK,XR_CURNMOD_GINDEX,XREF_PHYS_BLK,LAST_XR_CURNMOD_GINDEX

		ALIGN	4

XREF_PTR		DD	?
FIRST_XREF_BLK		DD	?
XR_CURNMOD_GINDEX	DD	?
LAST_XR_CURNMOD_GINDEX	DD	?
XREF_PHYS_BLK		DD	?

endif

if fg_virt

		public	BLOCK_TABLE,VIRTUAL_TABLE,EMS_PAGES,EMS_HANDLE1,EMS_HANDLE2,EMS_READ_STRUC,PHYS_LRU_BLOCK,VMFILE_BLK
		public	EMS_XMS_BLOCK,E_VIRTUAL_TABLE,EMS_WRITE_STRUC,EMS_PAGE_FRAME,EMS_PAGE_FRAME_END,PHYS_MRU_BLOCK,VIR_DEVICE
		PUBLIC	MINI_EMS_PAGE,VIRTUAL_NEXT,EMS_XMS_MRU,EMS_XMS_LRU,EMS_XMS_BOF,EMS_XMS_EOF,EMS_XMS_FREE_COUNT,HANDLE_HOLDER
		PUBLIC	XMS_LENGTH,XMS_SRC_HANDLE,XMS_SRC_OFFSET,XMS_DST_HANDLE,XMS_DST_OFFSET,XMS0_STUFF,XMS1_STUFF,XMS,VMFILE_GINDEX
		PUBLIC	UMB_PARAGRAPHS,PHYS_BEG_FREELIST,PHYS_END_FREELIST,EMS_XMS_BLOCK_LOG,PAGES_MAPPED,BLOCK_NEXT,PACK_TEMP_WORD
		PUBLIC	LS_MODULE_BLOCK,E_BLOCK_TABLE

.DATA

BLOCK_NEXT		DD	BLOCK_TABLE
VIRTUAL_NEXT		DD	VIRTUAL_TABLE
PAGES_MAPPED		DB	0
			DB	?		;AVAIL


.DATA?

PHYS_MRU_BLOCK		DW	?
PHYS_LRU_BLOCK		DW	?
PHYS_BEG_FREELIST	DW	?
PHYS_END_FREELIST	DW	?

BLOCK_TABLE		DW	32K/(PAGE_SIZE/1024) DUP(?);LOGICAL BLOCK FLAGS	*3/2
E_BLOCK_TABLE		LABEL	BYTE
VIRTUAL_TABLE		DW	32K/(PAGE_SIZE/1024) DUP(?);PTRS BACK TO BLOCK_TABLE  *3/2
E_VIRTUAL_TABLE 	LABEL	BYTE
;MRU_TABLE		DB	1K/(PAGE_SIZE/1024) DUP(?);LRU BUFFERING STUFF
EMS_XMS_BLOCK		DW	?		;EMS_XMS_STRUCT	8K/(PAGE_SIZE/1024) DUP(<>);EMS-XMS LRU STUFF
EMS_XMS_BLOCK_LOG	DW	?
;E_EMS_XMS_TABLE LABEL	BYTE
EMS_PAGES		DW	?	;# OF AVAILABLE EMS 16K PAGES
EMS_HANDLE1		DW	?
EMS_HANDLE2		DW	?
EMS_READ_STRUC		DB	18 DUP(?)
EMS_WRITE_STRUC		DB	18 DUP(?)
EMS_PAGE_FRAME		DW	?
EMS_PAGE_FRAME_END	DW	?
MINI_EMS_PAGE		DW	?
EMS_XMS_MRU		DW	?
EMS_XMS_LRU		DW	?
EMS_XMS_BOF		DW	?
EMS_XMS_EOF		DW	?
EMS_XMS_FREE_COUNT	DW	?

XMS_LENGTH		DD	?
XMS_SRC_HANDLE		DW	?
XMS_SRC_OFFSET		DD	?
XMS_DST_HANDLE		DW	?
XMS_DST_OFFSET		DD	?

XMS0_STUFF		DB	SIZE XMS_STRUC DUP(?)
XMS1_STUFF		DB	SIZE XMS_STRUC DUP(?)

XMS			DD	?
UMB_PARAGRAPHS		DW	5 DUP(?)

VMFILE_BLK		DW	?
HANDLE_HOLDER		DW	?
VIR_DEVICE		DW	?
VMFILE_GINDEX		DW	?
LS_MODULE_BLOCK		DW	?
PACK_TEMP_WORD		DW	?

endif

EXETABLE	DD	32K/(PAGE_SIZE/1024) DUP(?);MAX FILE IS 32 MEG...
if	fg_slrpack
		PUBLIC	EXEPACK_STRUCTURE
EXEPACK_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
		DD	1K/(PAGE_SIZE/1024) DUP(?)
endif

EXESTR_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2*12 DUP(?);1Mb TOTAL

REAL_RELOC_STRUCT	DB	SIZE SEQ_STRUCT DUP(?)		;WHEN USE FOR LIBNAMES, 10,000 SYMBOLS
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K

EXP_BUFFER		DD	64K/(PAGE_SIZE/4) DUP(?)	;MAX 64K EXPORTED SYMBOLS TO SORT

		ALIGN	4
SYMBOL_TPTR	LABEL	BYTE
SYMBOL_MODULE	DD	?
SYMBOL_HASH	DD	?
SYMBOL_LENGTH	DD	?
SYMBOL_TEXT	DB	SYMBOL_TEXT_SIZE DUP (?)

PRE_THREADS	THREAD_STUFF_STRUCT 	8 DUP(<>)


		ALIGN	4
MODULE_NAME	DB	SYMBOL_TEXT_SIZE+2 DUP(?)

		ALIGN	4
TEMP_RECORD	DB	MAX_RECORD_LEN DUP (?)
		DB	131 DUP(?)	;PLUS ROOM FOR NAME STRING+COUNTS

LIBASE_TEMP_RECORD	EQU	TEMP_RECORD

		ALIGN	4
TEMP_DATA_RECORD DB	MAX_LEDATA_LEN+64 DUP(?)	;FOR STORING LDATA DURING FIXUPP

NEW_FIXUPP	DB	NEW_FIXUPP_SIZE DUP(?)

TEMP_FIXUPP_RECORD	EQU	NEW_FIXUPP

if	fg_rom
		PUBLIC	OMF_BUFFER

OMF_BUFFER	DB	1K+32 DUP(?)

endif

if	fg_norm_exe

		PUBLIC	FARCALL_FIXUPP

FARCALL_FIXUPP	DB	INBUF_LEN DUP(?)	;MAX SIZE PER RECORD
endif

		ALIGN	4
FORREF_TEMP_RECORD	DB	4 DUP(?)	;

if	fg_segm OR fg_slrpack
		PUBLIC	ZEROS_16

		ALIGN	4
ZEROS_16	DB	16 DUP(?)

endif

		ALIGN	4

DOFLAG		MACRO	FLAG
		PUBLIC	FLAG
FLAG		DB	?
NUM_FLAGS	=	NUM_FLAGS+1
		ENDM

NUM_FLAGS	=	0

;	FIRST THE CONFIGURABLE FLAGS

FLAGS	LABEL	BYTE

DOFLAG	TD_FLAG
DOFLAG	DOSSEG_FLAG
DOFLAG	STACK_GROUP_FLAG
DOFLAG	CMDLINE_FREEFORMAT	;CHECKSUM_EXE_FLAG
DOFLAG	XREF_OUT
DOFLAG	SYMBOLS_OUT
DOFLAG	ABORT_ON_CHECKSUM
DOFLAG	DO_CHECKSUMING		;FOR OBJ'S

DOFLAG	ECHO_INDIRECT
DOFLAG	PAUSE_FLAG
DOFLAG	INFORMATION_FLAG
DOFLAG	EXEPACK_SELECTED
DOFLAG	LINENUMBERS_FLAG
DOFLAG	PRINT_GROUP
DOFLAG	DEFAULTLIBRARYSEARCH_FLAG
DOFLAG	PACKFUNCTIONS_FLAG	;ALLOW_LIB_FILES 	;CPARMAXALLOC_FLAG EQU	15

DOFLAG	$$SLR_CODE_FIRST	;DSALLOCATE_FLAG1
DOFLAG	_DELETE_EXE_ON_ERROR	;HIGH_FLAG1
DOFLAG	GROUPASSOCIATION_FLAG
DOFLAG	CODEVIEW_FLAG
DOFLAG	BATCH_FLAG
DOFLAG	FARCALLTRANSLATION_FLAG
DOFLAG	PACKCODE_FLAG
DOFLAG	PACKCODE_NO_SEGMENTS	;QUICKLIB_FLAG

DOFLAG	PRESERVE_IMPEXP_CASE	;EXTDICTIONARY_FLAG
DOFLAG	ECHO_ANY		;25
DOFLAG	CHECK_LO_BYTE
DOFLAG	ALPHA_ORDER_ALSO	;ALPHA ORDER MAP FILE?
DOFLAG	SCAN_LINK_ENVIRONMENT	;SOFT_EXTRNS		;?
DOFLAG	ERROR_NOT_REFERENCED
DOFLAG	NODOSSEG_FLAG
DOFLAG	HANDLE_EXE_ERRORFLAG	;RANDOM_LIBS

DOFLAG	NULLSDOSSEG_FLAG
DOFLAG	PACKDATA_FLAG
DOFLAG	NOPACKCODE_FLAG
DOFLAG	NOFARCALLTRANSLATION_FLAG
DOFLAG	TRIED_UMB
DOFLAG	TRIED_XMS
DOFLAG	TRIED_EMS
DOFLAG	FORCE_EMS_32

DOFLAG	EMS_IO_LEGAL
DOFLAG	CHECK_RELOCATIONS
DOFLAG	LOGO_OUTPUT
DOFLAG	PLUS_FOUND
DOFLAG	DETAILEDMAP_FLAG
DOFLAG	FIXDS_FLAG
DOFLAG	IGNORE_DUP_STARTS
DOFLAG	DOTS_FLAG

DOFLAG	DUP_MODNAMS_PLEASE
DOFLAG	REORDER_ALLOWED
DOFLAG	ALLOW_WINDOWS_EXEPACK
DOFLAG	ROOT_ENVIRONMENT_LEGAL
DOFLAG	EXEPACK_DOSAPP
DOFLAG	EXEPACK_WINAPP
DOFLAG	EXEPACK_OS2APP
DOFLAG	EXEPACK_WINDLL

DOFLAG	EXEPACK_OS2DLL
DOFLAG	WARN_LIB_DUPS
DOFLAG	PREV_DEF_IS_ERROR
DOFLAG	LIB_NOT_FOUND_FATAL
DOFLAG	SCAN_LIB_ENVIRONMENT
DOFLAG	CVPACK_FLAG
DOFLAG	COMDEF_SEARCH
DOFLAG	CMDLINE_FINAL

DOFLAG	NT_HOST_FLAG
DOFLAG	CV_WARNINGS

;
;	THESE FLAGS ARE JUST CLEARED AT STARTUP
;

	IF	NUM_FLAGS AND 7
	DB	8-(NUM_FLAGS AND 7) DUP(?)
	ENDIF

NUM_FLAGS	=	(NUM_FLAGS+7) AND 0FFF8H	;NEXT BYTE BOUNDARY

DOFLAG	INDIRECT_MODE		;THESE GET CLEARED ON STARTUP
DOFLAG	KEEPING_LINNUMS
;DOFLAG	DRIVE_VALID
;DOFLAG	SOURCE_PATH
;DOFLAG	PRINTER_IN_USE
;DOFLAG	CURN_GROUP_IS_DGROUP
DOFLAG	VIRTUAL_FILE_OPEN
;DOFLAG	IS_386
DOFLAG	MINI_EMS_FLAG
DOFLAG	FOUND_BASE
DOFLAG	DURING_OBJ		;FILES BEING PROCESSED
DOFLAG	REC_TYPE_VALID		;FOR ERRORS
DOFLAG	OUTPUT_COM_SYS		;COM OR SYS
DOFLAG	OUTPUT_COM
DOFLAG	OUTPUT_SYS
;DOFLAG	READ_ANY_LIBS		;
DOFLAG	LIB_TYPE
;DOFLAG	CVINFO_THIS_MODULE		;CODEVIEW STUFF IN THIS MODULE
DOFLAG	_CRITI_IN_PROGRESS
DOFLAG	CLEAN_UP_IN_PROGRESS
DOFLAG	STACK_SIZE_FLAG
;DOFLAG	ASEG_FLAG
DOFLAG	LAST_DATA_KEEP
DOFLAG	OBJS_DONE
DOFLAG	LIBS_DONE
;DOFLAG	DOING_LIBS
;DOFLAG	DOING_OUTPUTS
;DOFLAG	MAP_STARTED
DOFLAG	ABORTING
DOFLAG	FORCE_PATH
;DOFLAG	LIB_OPENED
DOFLAG	THIS_AMBIGUOUS		;CURRENT COMMAND IS AMBIGUOUS
;DOFLAG	MAP_SORT_FAIL
DOFLAG	LAST_DATA_LIDATA
DOFLAG	FOUND_THEADR
DOFLAG	LIB_OR_NOT
DOFLAG	FINAL_FIXUPPS
DOFLAG	NEW_LINHEADER
DOFLAG	OUT_FLUSHED
DOFLAG	DOING_DEBUG
DOFLAG	FORCE_CREATE
DOFLAG	SYMBOL_UNDEFINED	;USED BY FIXUPP2
DOFLAG	CV_SEPARATE
;DOFLAG	DEF_NUMBER_GOTTEN
DOFLAG	DEF_IN_PROGRESS
;DOFLAG	LAST_ORDER_SEGMENT
DOFLAG	SKIP_ORDERING
;DOFLAG	FIRST_ORDER_SEGMENT
DOFLAG	OUTPUT_ABS
DOFLAG	HEX_NEW_SEGMENT
DOFLAG	SEGAT_NEW
DOFLAG	SEGAT_WRAP
DOFLAG	RHEADR_FLAG
DOFLAG	OMITTING_SEGMENT
;DOFLAG	SKIP_SIGNAL
;DOFLAG	DOING_PHASE
DOFLAG	OMF_LINES
DOFLAG	OMF_PUBLICS
DOFLAG	OMF_NEW_SEGGRP
;DOFLAG	EOF_CRITICAL
;DOFLAG	MODE_SELECTED
DOFLAG	REALMODE
DOFLAG	PROTMODE
;DOFLAG	STUB_PROCESSING
DOFLAG	STUB_SUPPLIED
DOFLAG	OLD_SUPPLIED
DOFLAG	ENTRIES_POSSIBLE
DOFLAG	OUTPUT_SEGMENTED
DOFLAG	IOPL_USED
DOFLAG	MOVABLE_USED
DOFLAG	IMP_BY_NAME
;DOFLAG	INCREMENTAL
DOFLAG	WARNFIXUP
DOFLAG	OS2_FLAGS_DIFFERED
DOFLAG	MOVE_BYTES
DOFLAG	ANY_LNAMES
DOFLAG	DISKFULL_FIXING
DOFLAG	OPENT_DOING_STUB
DOFLAG	DOING_NODEF
DOFLAG	EMS_HANDLE1_VALID
DOFLAG	EMS_HANDLE2_VALID
DOFLAG	ALIGNMENT_SPECIFIED
DOFLAG	OS2_PAGE_ALIGN_DONE
DOFLAG	EXEPACK_FLUSHING
DOFLAG	EXEPACK_USING_NEW
DOFLAG	BELOW_100_WARNED
DOFLAG	SIGNON_DONE
;DOFLAG	DEF_NUMBER_ILLEGAL
DOFLAG	PARSE_IN_OVERLAY
DOFLAG	DEBUGGING_THIS
DOFLAG	FANCY_DEBUG
if	fg_slrpack
DOFLAG	SLRPACK_FLAG			;ACTIVE THIS SECTION
DOFLAG	SLRPACK_SELECTED		;REQUESTED AT ALL BY COMMAND
DOFLAG	SPECIAL_ZERO_AXCX
DOFLAG	DICT_FULL
DOFLAG	DICT2_FULL
DOFLAG	KEEPING_COMPRESSED
;DOFLAG SLRPACK_SUFFICIENT
DOFLAG	NO_SLRPACKING_DONE
DOFLAG	HUF_FIRST_TIME
DOFLAG	COMP_FIRST_INPUT
DOFLAG	QUIKPACK_FLAG
endif
if	fg_winpack
DOFLAG	WINPACK_SELECTED
DOFLAG	SEGPACK_SEGMENT
DOFLAG	SEGPACK_SELECTED
DOFLAG	WINPACK_LICENSED
endif
DOFLAG	FIRST_REPT_STORED
DOFLAG	LONGNAMES_FLAG
DOFLAG	NEW_CV_INFO
;DOFLAG	CONST_FLAG
;DOFLAG	STACK_SIZE_CHANGED
DOFLAG	GET_LINE_PARTIAL
DOFLAG	INBUF_EOF
if	any_overlays
DOFLAG	DOING_OVERLAYS
DOFLAG	OVERLAY_CLASS_DEFINED
DOFLAG	ANY_ALLOCATABLE
DOFLAG	SLROVL_ADDED
DOFLAG	DOING_RELOAD
DOFLAG	ALWAYSALL_FLAG
DOFLAG	SEGMOD_MOVED
DOFLAG	MULTI_LEVEL_MULTI_AREA
DOFLAG	USE_OVERLAY_INT
DOFLAG	SEXE_LOAD_PARA_FLAG
DOFLAG	SEXE_END_PARENT_FLAG
DOFLAG	SEXE_LENGTH_FLAG
DOFLAG	SEXE_FILES_FLAG
DOFLAG	DEBUG_FLAG
DOFLAG	ALLOCATE_ALL
DOFLAG	VECTORED_REFERENCE
endif
if	fg_plink
DOFLAG	CACHE_STATISTICS_FLAG
DOFLAG	PL_PCNT
DOFLAG	PL_K
DOFLAG	PL_VALUE
DOFLAG	SPECIFIC_PUBLICS
DOFLAG	EXCEPT_PUBLICS
DOFLAG	NOLOCALS_FLAG
DOFLAG	SPECIFIC_LOCALS
endif
DOFLAG	IGNORE_PRESERVE
;DOFLAG	STACK_ALIGNED
DOFLAG	SEGMENTS_MAP
DOFLAG	MAPFILE_SELECTED
DOFLAG	DEFFILE_SELECTED
;DOFLAG	DOING_FIRST_SECTION
DOFLAG	CHAINING_RELOCS
DOFLAG	PACKING_RELOCS
DOFLAG	EXEPACK_BODY
DOFLAG	REFERENCING_LIBS
;DOFLAG	WEAK_DEFINED
DOFLAG	DOING_START_ADDRESS

if	fg_segm OR fg_pe
DOFLAG	RC_SUPPLIED
DOFLAG	RC_REORDER
DOFLAG	RC_REORDER_SEGS
DOFLAG	RC_GUESSED
DOFLAG	STUB_NONE
DOFLAG	HEAP_MAXVAL
DOFLAG	RC_PRELOADS
DOFLAG	NOEMUFLOAT_FLAG
DOFLAG	FORCE_DOS_MODE
DOFLAG	EXEHDR_ERROR_FLAG
DOFLAG	IMPLIB_FLAG
DOFLAG	IMPLIB_COFF_FLAG
DOFLAG	IMPDEF_FLAG
DOFLAG	WINVER_SELECTED
DOFLAG	RES_32_BIT
DOFLAG	POST_INSTALL_FIX
endif
DOFLAG	OPREADS_DONE

DOFLAG	PMLIB_FLAG
DOFLAG	BIG_ENDIAN_FLAG
DOFLAG	LNKDIR_FLAG
DOFLAG	NEED_MODULES_SEARCHED
DOFLAG	USING_TEMP_RECORD
DOFLAG	DID_DICT_OFFSET
DOFLAG	NEED_MODULES_INSTALLED
DOFLAG	SKIP_OUTFILE_LINK
DOFLAG	CV_4_TYPE
DOFLAG	CV_SYM1_TYPE
DOFLAG	LAST_DATA_COMDAT
DOFLAG	PCODE_NEW_EXE
DOFLAG	PCODE_OMIT_PUBLICS
DOFLAG	PCODE_RUN_MPC
DOFLAG	PCH_HERE
DOFLAG	MAP_FLUSHED
DOFLAG	CVPACK_RUNNING
if	fg_td
DOFLAG	KEEPING_THIS_TDBG
DOFLAG	TDBG_F9_FOUND
DOFLAG	TD_DEFAULTS_INSTALLED
DOFLAG	TD_SMEM_DOING_FIRST
DOFLAG	TD_SMEM_IN_PROGRESS
DOFLAG	TLINK_SYNTAX
DOFLAG	TLINK_X_MAPFILE
DOFLAG	TLINK_INIT_SEGMENTS
DOFLAG	TLINK_DEFAULT_MODE
endif
DOFLAG	TLINK_OUTTYPE_FOUND
DOFLAG	ALL_EXPORTS_BY_ORDINAL
DOFLAG	NEED_MDB_RECORD
DOFLAG	DOING_CFG
DOFLAG	SLASH_FOUND
DOFLAG	DEBUG_ALL
DOFLAG	KILL_NONRESIDENT_NAMES
if	fgh_dpmi
DOFLAG	FAULT_IN_PROGRESS
DOFLAG	IO_BLKS_USED_UP
endif
DOFLAG	CTRL_C_FOUND
DOFLAG	_NO_CANCEL_FLAG
DOFLAG	CANCEL_REQUESTED
if	fg_symc
DOFLAG	COMENT_FOUND
endif
if	fg_segm OR fg_pe
DOFLAG	HEAP_SIZE_FLAG
DOFLAG	OBJECT_FLAGS_DEFINED
endif

DOFLAG	ANY_USE32
DOFLAG	NOPACKDATA_FLAG
DOFLAG	STORE_DSSICX_USE_ZERO

if	fg_pe
DOFLAG	PE_SUBSYSTEM_DEFINED
DOFLAG	PE_SUBSYS_VERSION_DEFINED
DOFLAG	PE_BASE_SPECIFIED
DOFLAG	PE_BASE_FIXED
DOFLAG	PE_LARGE_ADDRESS_AWARE
DOFLAG	OUTPUT_PE
DOFLAG	DOING_tls
DOFLAG	GOT_tls_CLASS
endif

if	fg_cvpack
DOFLAG	DOING_4K_ALIGN
DOFLAG	CV_TYPES_VALID
endif
DOFLAG	LOD_SUPPLIED
DOFLAG	DUP_NAME_REPORTED
DOFLAG	OUTPUT_32BITS

if	fgh_win32
DOFLAG	HANDLES_EXPANDED
endif

DOFLAG	MODEL_CONFLICT

if	fgh_anythreads
DOFLAG	_HOST_THREADED
DOFLAG	ASCIZ1_WAITING
DOFLAG	ERROR1_WAITING
endif
DOFLAG	_FINAL_ABORTING
DOFLAG	SUPPORT_AT_INDIRECT
DOFLAG	AFTER_DEF_DONE
DOFLAG	FUZZY_JUST_CHECK
DOFLAG	ANY_PUBLICS
DOFLAG	VERBOSE_OMF

		ALIGN	4

if	any_overlays

		PUBLIC	CACHE_REG_TABLE,CACHE_EMS_TABLE,CACHE_XMS_TABLE,CACHE_UMB_TABLE

		ALIGN	4

CACHE_EMS_TABLE CACHE_STRUCT<>
CACHE_XMS_TABLE CACHE_STRUCT<>
CACHE_REG_TABLE CACHE_STRUCT <>
CACHE_UMB_TABLE CACHE_STRUCT	<>

endif
THEADR_TEMP     DB      SYMBOL_TEXT_SIZE DUP(?)

if	fg_segm

		PUBLIC	IMPEXP_MOD,IMPEXP_NAM,IMPEXP_INTNAM,OS2_EXEHDR_START,OLD_EXE_HDR_SIZE,SEG_OS2_FLAGS,RESNAMES_SIZE
		PUBLIC	PADCODE,PADDATA,ENTRY_TABLE,MOVABLE_MASK,RESIDENT_STRUCTURE,IMPMOD_GARRAY,IMPMOD_HASH,FIRST_IMPMOD_GINDEX
		PUBLIC	NONRESIDENT_STRUCTURE,LOWEST_SEGMENT,HIGHEST_SEGMENT,ENTRY_OFFSET,IMP_MODNUM,IMP_ORDNUM,LAST_IMPMOD_GINDEX
		PUBLIC	EXP_ORDNUM,EXP_PWORDS,EXP_FLAGS,EXP_FLAGS_EXT,EXP_BOTH_FLAGS
		PUBLIC  PENT_STUFF,ENTRY_STUFF,ENTRYNAME_STUFF,IMPNAME_STUFF,ZERO_LENGTH_SEGMENTS
		PUBLIC	LATEST_PENT_GINDEX,NONRES_BYTES_LEFT,ENTRYNAME_BITS,IMPNAMES_SIZE,WINMAIN_GINDEX,LAST_ENTRYNAME_GINDEX
		PUBLIC	RESOURCE_FLAGS,RESOURCE_SIZE,NEXT_RESOURCE_MASTER_PTR,NEXT_RESOURCE_PTR,ENTRYNAME_COUNT,N_RTNLS
		PUBLIC	RESOURCE_BLOCK_MASTER_PTRS,RESOURCE_NAME_OFFSET,RESOURCE_STUFF,FIRST_RTNL_GINDEX,LAST_RTNL_GINDEX
		PUBLIC	RESOURCE_STUFF,RESOURCE_FILE_ADDR,RESOURCE_TYPE_ID,IMPLIB_PAGEBITS,N_RESTYPENAMES,N_IMPMODS
		PUBLIC	RESOURCE_TABLE_SIZE,TLINK_OUTTYPE,FIRST_ENTRYNAME_GINDEX,FIRST_RESNAME_GINDEX,LAST_RESNAME_GINDEX
		PUBLIC	RESOURCE_BYTES_SO_FAR,NONRESNAMES_SIZE,IMPNAME_GARRAY,ENTRYNAME_GARRAY,PENT_GARRAY,ENTRY_GARRAY
		PUBLIC	APPLOADER_SEGMENT_GINDEX,CURRENT_OFFSET,RESOURCE_NAMES_SIZE,EXPORT_TABLE_USE,IMPORT_TABLE_USE
		PUBLIC	IMPDEF_FILE_GINDEX,IMPLIB_COFF_FILE_GINDEX,IMPLIB_FILE_GINDEX,IMPLIB_PAGESIZE,ENTRYNAMES_TOTAL_LENGTH
		PUBLIC	RESNAME_GARRAY,RES_TYPENAME_HASH,RESTYPE_HASH,RESNAME_HASH,RESOURCE_HASHES,FIRST_PENT_GINDEX
		PUBLIC	RES_TYPENAME_HASH_TABLE_PTR,RESTYPE_HASH_TABLE_PTR,RESNAME_HASH_TABLE_PTR,RESTYPE_BYNAME_GINDEX
		PUBLIC	RESTYPE_BYORD_GINDEX,RESTYPE_N_BYNAME,RESTYPE_N_BYORD,RESTYPE_GARRAY,RES_TYPE_NAME_GARRAY,RTNL_GARRAY
		PUBLIC	LAST_PENT_GINDEX,SORTED_EXPORTS_USE

		.DATA?

IMPEXP_MOD	DB	SYMBOL_TEXT_SIZE+4 DUP(?)		;ALSO USED BY READ_RESOURCES FOR ERROR CONTROL...
IMPEXP_NAM	DB	INBUF_LEN+4 DUP(?)			;USED BY DEF_aPPLOADER
IMPEXP_INTNAM	DB	SYMBOL_TEXT_SIZE+4 DUP(?)		;XREF BUFFER NOT IN USE

		ALIGN	4

IMPMOD_HASH_TABLE	DD	IMPMOD_HASH_SIZE DUP(?)

		.DATA

		ALIGN	4

IMPMOD_GARRAY		STD_PTR_S <0,0,0,0,IMPMOD_POOL_GET,IMPMODS_EQU>
IMPNAME_GARRAY		STD_PTR_S <0,0,0,0,IMPNAME_POOL_GET,IMPNAMES_EQU>
ENTRYNAME_GARRAY	STD_PTR_S <0,0,0,0,ENTRYNAME_POOL_GET,ENTNAMES_EQU>
PENT_GARRAY		STD_PTR_S <0,0,0,0,PENT_POOL_GET,PENTS_EQU>
ENTRY_GARRAY		STD_PTR_S <0,0,0,0,ENTRY_POOL_GET,ENTRIES_EQU>
RESNAME_GARRAY		STD_PTR_S <0,0,0,0,RESNAME_POOL_GET,RESNAMES_EQU>
RESTYPE_GARRAY		STD_PTR_S <0,0,0,0,RESTYPE_POOL_GET,RESTYPES_EQU>
RES_TYPE_NAME_GARRAY	STD_PTR_S <0,0,0,0,RES_TYPENAME_POOL_GET,RES_TYPENAMES_EQU>
RTNL_GARRAY		STD_PTR_S <0,0,0,0,RTNL_POOL_GET,RTNLS_EQU>


IMPLIB_PAGESIZE		DD	16		;DEFAULT LIBRARY PAGESIZE
IMPMOD_HASH		DD	IMPMOD_HASH_SIZE
IMPMOD_HASH_TABLE_PTR	DD	IMPMOD_HASH_TABLE

if	page_size EQ 8K

RES_TYPENAME_HASH	DD	PRIME_1K
RESTYPE_HASH		DD	PRIME_512
RESNAME_HASH		DD	PRIME_512

RES_TYPENAME_HASH_TABLE_PTR	DD	0
RESTYPE_HASH_TABLE_PTR	DD	4K
RESNAME_HASH_TABLE_PTR	DD	6K

else

RES_TYPENAME_HASH	DD	PRIME_2K
RESTYPE_HASH		DD	PRIME_1K
RESNAME_HASH		DD	PRIME_1K

RES_TYPENAME_HASH_TABLE_PTR	DD	0
RESTYPE_HASH_TABLE_PTR	DD	8K
RESNAME_HASH_TABLE_PTR	DD	12K

endif


		.DATA?

RESOURCE_HASHES		DD	?
RESNAMES_SIZE		DD	?
IMPNAMES_SIZE		DD	?
NONRESNAMES_SIZE	DD	?
OS2_EXEHDR_START	DD	?
CURRENT_OFFSET		DD	?
ENTRYNAMES_TOTAL_LENGTH	DD	?
FIRST_ENTRYNAME_GINDEX	DD	?
LAST_ENTRYNAME_GINDEX	DD	?
ENTRYNAME_COUNT		DD	?
IMPLIB_PAGEBITS		DD	?

OLD_EXE_HDR_SIZE	DD	?
SEG_OS2_FLAGS		DD	?

PADCODE			DD	?
PADDATA			DD	?
IMPLIB_FILE_GINDEX	DD	?
IMPLIB_COFF_FILE_GINDEX	DD	?
IMPDEF_FILE_GINDEX	DD	?

FIRST_IMPMOD_GINDEX	DD	?
LAST_IMPMOD_GINDEX	DD	?
N_IMPMODS		DD	?

FIRST_PENT_GINDEX	DD	?
LAST_PENT_GINDEX	DD	?

RESTYPE_BYNAME_GINDEX	DD	?
RESTYPE_BYORD_GINDEX	DD	?
RESTYPE_N_BYNAME	DD	?
RESTYPE_N_BYORD		DD	?
N_RTNLS			DD	?
N_RESTYPENAMES		DD	?

FIRST_RTNL_GINDEX	DD	?
LAST_RTNL_GINDEX	DD	?
FIRST_RESNAME_GINDEX	DD	?
LAST_RESNAME_GINDEX	DD	?

EXPORT_TABLE_USE	DB	?
IMPORT_TABLE_USE	DB	?
			DW	?

WINMAIN_GINDEX		DD	?

ENTRY_TABLE		DD	32K/PAGE_SIZE * 16 DUP(?)	;PAGE_SIZE BLOCK FOR BUILDING ENTRIES

MOVABLE_MASK		DD	?	;
TLINK_OUTTYPE		DD	?

RESIDENT_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
NONRESIDENT_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
LOWEST_SEGMENT		DD	?
HIGHEST_SEGMENT		DD	?
ENTRY_OFFSET	 	DD	?
LATEST_PENT_GINDEX	DD	?
ZERO_LENGTH_SEGMENTS	DD	?

IMP_MODNUM		DD	?
IMP_ORDNUM		DD	?

EXP_ORDNUM		DD	?

EXP_PWORDS		DB	?
EXP_FLAGS		DB	?
EXP_FLAGS_EXT		DB	?
        		DB	?
EXP_BOTH_FLAGS        	EQU     WORD PTR EXP_FLAGS

NONRES_BYTES_LEFT	DD	?
APPLOADER_SEGMENT_GINDEX	DD	?
ENTRYNAME_BITS		DD	?

;RESOURCE_TYPE		DW	?
;RESOURCE_TYPE_FLAG	DW	?
;RESOURCE_TYPE_GINDEX	DW	?
RESOURCE_TYPE_ID	DD	?

;RESOURCE_NAME		DW	?
;RESOURCE_NAME_FLAG	DW	?
;RESOURCE_NAME_GINDEX	DW	?

;RESOURCE_TYPE_NAME_GINDEX	DW	?

RESOURCE_FLAGS		DD	?
RESOURCE_SIZE		DD	?
NEXT_RESOURCE_MASTER_PTR	DD	?
NEXT_RESOURCE_PTR	DD	?
RESOURCE_TYPE_PTR	DD	?
RESOURCE_BLOCK_MASTER_PTRS	DD	?
RESOURCE_NAME_OFFSET	DD	?
RESOURCE_FILE_ADDR	DD	?
RESOURCE_TABLE_SIZE	DD	?
RESOURCE_NAMES_SIZE	DD	?
RESOURCE_BYTES_SO_FAR	DD	?
SORTED_EXPORTS_USE	DB	?
			DB	?	;AVAIL
			DW	?	;AVAIL

PENT_STUFF		ALLOCS_STRUCT	<>
ENTRYNAME_STUFF		ALLOCS_STRUCT	<>
IMPNAME_STUFF		ALLOCS_STRUCT	<>
ENTRY_STUFF		ALLOCS_STRUCT	<>
RESOURCE_STUFF		ALLOCS_STRUCT	<>

endif

		ALIGN	4
if	fgh_outhreads
MYO_STUFF	MYO_STRUCT	N_W_THREADS DUP(<>)
else
MYO_STUFF	MYO_STRUCT	4 DUP(<>)	;JUST THREE IN DOS (.MAP, .EXE, .TMP, .din)
endif

		ALIGN	4
if	fgh_inthreads
MYI_STUFF	MYI_STRUCT	N_R_THREADS DUP(<>)
else
MYI_STUFF	MYI_STRUCT	<>		;JUST ONE IN DOS
endif

		align	4

if	fgh_anythreads
XOUTBUF 	DB	INBUF_LEN*2 DUP(?)	;USED BY XREF THREAD
EOUTBUF 	DB	INBUF_LEN*2 DUP(?)	;USED BY ERROR OUTPUT
else
XOUTBUF 	EQU	OUTBUF		;SAME BUFFER IN DOS...
EOUTBUF 	EQU	OUTBUF		;BUFFER FOR ERROR MESSAGES
endif


DTA		DB	44 DUP(?)


if	fg_winpack
		PUBLIC	WINPACK_OBJ_DEVICE

WINPACK_OBJ_DEVICE	DB	MYI_STRUCT.MYI_FILLBUF+4 DUP(?)

endif

if	fgh_win32

		PUBLIC	_STDOUT,STDIN,BEGIN_BSS,FINISH_BSS,BEGIN_DATA,FINISH_DATA,ERROR_ASCIZ,ME_TEXT

BEG_BSS		SEGMENT	PARA	'BSSBEG'

BEGIN_BSS	DD	?

BEG_BSS		ENDS

END_BSS		SEGMENT PARA	'BSSEND'

FINISH_BSS	DD	?

END_BSS		ENDS

BEG_DATA	SEGMENT	PARA	'DATABEG'

BEGIN_DATA	DD	?

BEG_DATA		ENDS

END_DATA	SEGMENT PARA	'DATAEND'

FINISH_DATA	DD	?

END_DATA	ENDS


		.DATA

_STDOUT		DD	INVALID_HANDLE_VALUE
STDIN		DD	INVALID_HANDLE_VALUE

		.DATA?

ME_TEXT		DB	256 DUP(?)
ERROR_ASCIZ	DB	256 DUP(?)

endif

STACK		SEGMENT DWORD STACK 'STACK'

		ALIGN	4
if	0;fgh_os2
			DB	4K DUP(?)

MAP_THREAD_STACK	LABEL	BYTE

endif

STACK		ENDS

DGROUP		GROUP	STACK

.DATA?

STARTING_ESP		DD	?

FIX2_TINDEX		DD	?
FIX2_FINDEX		DD	?
FIX2_TT			DD	?
FIX2_FF			DD	?
FIX2_OFFSET		DD	?
FIX2_LOC		DD	?
FIX2_SEGMOD_STUFF	SEGMOD_STRUCT<>
FIX2_SM_LAST_DAT	DD	?
FIX2_SEGMENT_STUFF	SEGMENT_STRUCT<>
FIX2_FIXUPP_STUFF	FIXUPP_HEADER_TYPE<>
			DD	?		;FOR FARCALL...

FIX2_LDATA_STUFF	LDATA_HEADER_TYPE<>
FIX2_LDATA_LOC		DD	?
FIX2_LDATA_PTR		DD	?
FIX2_LDATA_LOG		DD	?
FIX2_LDATA_BASE		DD	?
FIX2_LDATA_EOR		DD	?

FIX2_TOFFSET		DD	?
FIX2_TFRAME		DD	?
FIX2_OS2_TFLAGS		DD	?
FIX2_EXEPACK_BASE	DD	?
FIX2_SEG_GINDEX		DD	?		;USED FOR TLS

FIX2_OS2_TNUMBER	EQU	FIX2_TFRAME

FIX2_FFRAME		DD	?

FIX2_OS2_FNUMBER	EQU	FIX2_FFRAME

FIX2_TTYPE		DB	?
FIX2_FTYPE		DB	?
			DW	?

FIX2_LDATA_SEGMENT_GINDEX	DD	?
FIX2_FIXUPP_BASE	DD	?
FIX2_FIXUPP_LOG		DD	?
FIX2_FIXUPP_EOR		DD	?
FIX2_NEW_SEGMOD_GINDEX	DD	?
FIX2_STACK_LARGEST	DD	?
FIX2_STACK_DELTA	DD	?
FIX2_STACK_DELTA_ADDER	DD	?
FIX2_SKIP_BYTES		DD	?

FIX2_TARG_TABLE		DD	?
FIX2_RELOC_OFFSET	DD	?

;FIX2_FC_LENGTH		EQU	FIX2_

FIX2_SM_BASE_SEG_GINDEX	EQU	(FIX2_SEGMOD_STUFF._SM_BASE_SEG_GINDEX)
FIX2_SM_NEXT_SEGMOD_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_NEXT_SEGMOD_GINDEX
FIX2_SM_START		EQU	FIX2_SEGMOD_STUFF._SM_START
FIX2_SM_LEN		EQU	FIX2_SEGMOD_STUFF._SM_LEN
FIX2_SM_FIRST_DAT	EQU	FIX2_SEGMOD_STUFF._SM_FIRST_DAT
FIX2_SM_SECTION_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_SECTION_GINDEX
FIX2_SM_PLTYPE		EQU	FIX2_SEGMOD_STUFF._SM_PLTYPE
FIX2_SM_FLAGS_2		EQU	FIX2_SEGMOD_STUFF._SM_FLAGS_2
FIX2_SM_ALIGN		EQU	FIX2_SEGMOD_STUFF._SM_ALIGN
FIX2_SM_FLAGS		EQU	FIX2_SEGMOD_STUFF._SM_FLAGS
FIX2_SM_MODULE_CSEG_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_MODULE_CSEG_GINDEX

FIX2_SEG_NEXT_HASH_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_NEXT_HASH_GINDEX
FIX2_SEG_NEXT_SEG_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_NEXT_SEG_GINDEX
FIX2_SEG_CLASS_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_CLASS_GINDEX
FIX2_SEG_GROUP_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_GROUP_GINDEX
FIX2_SEG_OFFSET			EQU	FIX2_SEGMENT_STUFF._SEG_OFFSET
FIX2_SEG_OS2_FLAGS		EQU	FIX2_SEGMENT_STUFF._SEG_OS2_FLAGS
FIX2_SEG_OS2_NUMBER		EQU	FIX2_SEGMENT_STUFF._SEG_OS2_NUMBER
FIX2_SEG_FIRST_SEGMOD_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_FIRST_SEGMOD_GINDEX
FIX2_SEG_LAST_SEGMOD_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_LAST_SEGMOD_GINDEX
;FIX2_SEG_SECTION_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_SECTION_GINDEX
;FIX2_SEG_PLTYPE			EQU	FIX2_SEGMENT_STUFF._SEG_PLTYPE
FIX2_SEG_32FLAGS		EQU	FIX2_SEGMENT_STUFF._SEG_32FLAGS
FIX2_SEG_COMBINE		EQU	FIX2_SEGMENT_STUFF._SEG_COMBINE
FIX2_SEG_TYPE			EQU	FIX2_SEGMENT_STUFF._SEG_TYPE

FIX2_SEG_LEN			EQU	FIX2_SEGMENT_STUFF._SEG_LEN
FIX2_SEG_FRAME			EQU	FIX2_SEGMENT_STUFF._SEG_FRAME

FIX2_FC_SEGMOD_GINDEX		EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_SEGMOD_GINDEX
FIX2_FC_LENGTH			EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_LENGTH
FIX2_FC_BLOCK_BASE		EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_BLOCK_BASE

FIX2_LD_NEXT_LDATA		EQU	FIX2_LDATA_STUFF._LD_NEXT_LDATA
FIX2_LD_TYPE			EQU	FIX2_LDATA_STUFF._LD_TYPE
FIX2_LD_BLOCK_BASE		EQU	FIX2_LDATA_STUFF._LD_BLOCK_BASE
FIX2_LD_LENGTH			EQU	FIX2_LDATA_STUFF._LD_LENGTH
FIX2_LD_OFFSET			EQU	FIX2_LDATA_STUFF._LD_OFFSET

FIX2_FH_NEXT_FIXUPP		EQU	FIX2_FIXUPP_STUFF._FH_NEXT_FIXUPP
FIX2_FH_TYPE			EQU	FIX2_FIXUPP_STUFF._FH_TYPE
FIX2_FH_XTRA			EQU	FIX2_FIXUPP_STUFF._FH_XTRA
FIX2_FH_BLOCK_BASE		EQU	FIX2_FIXUPP_STUFF._FH_BLOCK_BASE
FIX2_FH_LENGTH			EQU	FIX2_FIXUPP_STUFF._FH_LENGTH

FIX2_IMP_OFFSET 	DD	?
FIX2_IMP_MODULE 	DD	?
FIX2_IMP_FLAGS		EQU	(FIX2_OS2_TNUMBER)

FIX2_TFRAME_SEG		EQU	(FIX2_TFRAME)


		PUBLIC	FIX2_TINDEX,FIX2_FINDEX,FIX2_TT,FIX2_FF,FIX2_OFFSET,FIX2_LOC,FIX2_SEGMOD_STUFF,FIX2_LDATA_LOC,FIX2_TOFFSET
		PUBLIC	FIX2_FFRAME,FIX2_SM_BASE_SEG_GINDEX,FIX2_SM_NEXT_SEGMOD_GINDEX,FIX2_SM_START,FIX2_SM_LEN,FIX2_SM_FIRST_DAT
		PUBLIC	FIX2_SM_SECTION_GINDEX,FIX2_SM_PLTYPE,FIX2_SM_FLAGS_2,FIX2_SM_ALIGN,FIX2_SM_FLAGS,FIX2_SM_MODULE_CSEG_GINDEX
		PUBLIC	FIX2_SEGMENT_STUFF,FIX2_SEG_NEXT_HASH_GINDEX,FIX2_SEG_NEXT_SEG_GINDEX,FIX2_SEG_CLASS_GINDEX,FIX2_SEG_GROUP_GINDEX
		PUBLIC	FIX2_SEG_OFFSET,FIX2_SEG_OS2_FLAGS,FIX2_SEG_OS2_NUMBER,FIX2_SEG_32FLAGS,FIX2_FC_BLOCK_BASE
		PUBLIC	FIX2_SEG_COMBINE,FIX2_SEG_TYPE,FIX2_SEG_LEN,FIX2_SEG_FRAME,FIX2_TTYPE,FIX2_FTYPE,FIX2_LDATA_SEGMENT_GINDEX
		PUBLIC	FIX2_FIXUPP_BASE,FIX2_FIXUPP_EOR,FIX2_FIXUPP_LOG,FIX2_LDATA_LOG,FIX2_OS2_TNUMBER,FIX2_OS2_TFLAGS,FIX2_TFRAME
		PUBLIC	FIX2_OS2_FNUMBER,FIX2_FC_LENGTH,FIX2_FC_SEGMOD_GINDEX,FIX2_FIXUPP_STUFF,FIX2_LDATA_STUFF,FIX2_LD_NEXT_LDATA
		PUBLIC	FIX2_LD_TYPE,FIX2_LD_LENGTH,FIX2_LD_OFFSET,FIX2_FH_NEXT_FIXUPP,FIX2_FH_TYPE,FIX2_FH_XTRA
		PUBLIC	FIX2_FH_LENGTH,FIX2_IMP_OFFSET,FIX2_IMP_MODULE,FIX2_IMP_FLAGS,FIX2_LDATA_PTR,FIX2_LDATA_BASE
		PUBLIC	FIX2_LDATA_EOR,FIX2_TFRAME_SEG,FIX2_SM_LAST_DAT,FIX2_EXEPACK_BASE,FIX2_SEG_GINDEX
		PUBLIC	FIX2_TARG_TABLE,FIX2_NEW_SEGMOD_GINDEX,FIX2_STACK_LARGEST,FIX2_STACK_DELTA,FIX2_STACK_DELTA_ADDER
		PUBLIC	FIX2_SKIP_BYTES,FIX2_RELOC_OFFSET,FIX2_LD_BLOCK_BASE,FIX2_FH_BLOCK_BASE

		PUBLIC	ALLOCS_TABLES,ALLOCS_TABLES_LEN

		.DATA

ALLOCS_TABLES	LABEL	DWORD
		DD	LNAME_STUFF,LNAME_TXT
		DD	RELOC_STUFF,RELOC_TXT
		DD	SSYM_STUFF,SSYM_TXT
		DD	P1ONLY_STUFF,P1ONLY_TXT
		DD	TILLMIDDLE_STUFF,TILLMIDDLE_TXT
		DD	SEGMENT_STUFF,SEGMENT_TXT
if	fg_segm
		DD	PENT_STUFF,PENT_TXT
		DD	ENTRYNAME_STUFF,ENTRYNAME_TXT
		DD	IMPNAME_STUFF,IMPNAME_TXT
		DD	ENTRY_STUFF,ENTRY_TXT
;		DW	RESOURCE_NAME_STUFF,RESOURCE_NAME_TXT
;		DW	RESOURCE_TYPE_STUFF,RESOURCE_TYPE_TXT
		DD	RESOURCE_STUFF,RESOURCE_TXT
endif
if	fg_td
		DD	TD_NAME_STUFF,TD_NAME_TXT
		DD	TD_GLOCAL_STUFF,TD_GLOCAL_TXT
		DD	TD_GTYPE_STUFF,TD_GTYPE_TXT
		DD	TD_GSMEM_STUFF,TD_GSMEM_TXT
		DD	TD_GCLASS_STUFF,TD_GCLASS_TXT
endif
if	alloc_support
		DD	PUBALLOC_STUFF,PUBALLOC_TXT
		DD	LIBALLOC_STUFF,LIBALLOC_TXT
endif
if      fg_pe
                DD      PAGE_RELOC_STUFF,PAGE_RELOC_TXT
endif
if      fg_cvpack
                DD      CV_GSYM_STUFF,CV_GSYM_TXT
                DD      CV_LTYPE_STUFF,CV_LTYPE_TXT
                DD      CV_GTYPE_STUFF,CV_GTYPE_TXT
endif

ALLOCS_TABLES_LEN	EQU	($-ALLOCS_TABLES)/4

if	debug

DBB		EQU	<DB>

else

DBB		EQU	<EQU 1;>

endif

LNAME_TXT	DBB	LENGTH LNAME_TXT-1,'Lname_Stuff'
RELOC_TXT	DBB	LENGTH RELOC_TXT-1,'Reloc Stuff'
SSYM_TXT	DBB	LENGTH SSYM_TXT-1,'Symbols Stuff'
P1ONLY_TXT	DBB	LENGTH P1ONLY_TXT-1,'Pass1 Stuff'
TILLMIDDLE_TXT	DBB	LENGTH TILLMIDDLE_TXT-1,'Middle Stuff'
SEGMENT_TXT	DBB	LENGTH SEGMENT_TXT-1,'Segment Stuff'
if	fg_segm
PENT_TXT	DBB	LENGTH PENT_TXT-1,'Pent Stuff'
ENTRYNAME_TXT	DBB	LENGTH ENTRYNAME_TXT-1,'Entryname Stuff'
IMPNAME_TXT	DBB	LENGTH IMPNAME_TXT-1,'ImpName Stuff'
ENTRY_TXT	DBB	LENGTH ENTRY_TXT-1,'Entry Stuff'
RESOURCE_NAME_TXT DBB	LENGTH RESOURCE_NAME_TXT-1,'Resource Name Stuff'
RESOURCE_TYPE_TXT DBB	LENGTH RESOURCE_TYPE_TXT-1,'Resource Type Stuff'
RESOURCE_TXT	DBB	LENGTH RESOURCE_TXT-1,'Resource Stuff'
endif
if	fg_td
TD_NAME_TXT	DBB	LENGTH TD_NAME_TXT-1,'TD Names'
TD_GLOCAL_TXT	DBB	LENGTH TD_GLOCAL_TXT-1,'TD Locals'
TD_GTYPE_TXT	DBB	LENGTH TD_GTYPE_TXT-1,'TD Types'
TD_GSMEM_TXT	DBB	LENGTH TD_GSMEM_TXT-1,'TD Smems'
TD_GCLASS_TXT	DBB	LENGTH TD_GCLASS_TXT-1,'TD Classes'
endif
if      fg_pe
PAGE_RELOC_TXT  DBB     LENGTH PAGE_RELOC_TXT-1,'PE Page Relocs'
endif
if      fg_cvpack
CV_GSYM_TXT     DBB     LENGTH CV_GSYM_TXT-1,'CV Global Syms'
CV_LTYPE_TXT    DBB     LENGTH CV_LTYPE_TXT-1,'CV Local Types'
CV_GTYPE_TXT    DBB     LENGTH CV_GTYPE_TXT-1,'CV Global Types'
endif


if	fg_td
PARALLELS		SEGMENT	WORD PUBLIC	'DATA'

PARALLEL_TABLES_LEN	EQU	($-PARALLEL_TABLES)/2

PARALLELS		ENDS
endif

		END

